<P> After his travels, Sima was chosen to be a Palace Attendant in the government, whose duties were to inspect different parts of the country with Emperor Wu in 122 BC . Sima married young and had one daughter . In 110 BC, at the age of thirty - five, Sima Qian was sent westward on a military expedition against some "barbarian" tribes . That year, his father fell ill and could not attend the Imperial Feng Sacrifice . Suspecting his time was running out, he summoned his son back home to complete the historical work he had begun . Sima Tan wanted to follow the Annals of Spring and Autumn - the first chronicle in the history of Chinese literature . Fueled by his father's inspiration, Sima Qian started to compile Shiji, which became known in English as the Records of the Grand Historian, in 109 BC . Three years after the death of his father, Sima Qian assumed his father's previous position as Court Astrologer . In 105 BC, Sima was among the scholars chosen to reform the calendar . As a senior imperial official, Sima was also in the position to offer counsel to the emperor on general affairs of state . </P> <P> In 99 BC, Sima Qian became embroiled in the Li Ling affair, where Li Ling and Li Guangli, two military officers who led a campaign against the Xiongnu in the north, were defeated and taken captive . Emperor Wu attributed the defeat to Li Ling, with all government officials subsequently condemning him for it . Sima was the only person to defend Li Ling, who had never been his friend but whom he respected . Emperor Wu interpreted Sima's defence of Li as an attack on his brother - in - law, Li Guangli, who had also fought against the Xiongnu without much success, and sentenced Sima to death . At that time, execution could be commuted either by money or castration . Since Sima did not have enough money to atone his "crime", he chose the latter and was then thrown into prison, where he endured three years . He described his pain thus: "When you see the jailer you abjectly touch the ground with your forehead . At the mere sight of his underlings you are seized with terror...Such ignominy can never be wiped away ." Sima called his castration "the worst of all punishments". </P> <P> In 96 BC, on his release from prison, Sima chose to live on as a palace eunuch to complete his histories, rather than commit suicide as was expected of a gentleman - scholar who had been disgraced with castration . As Sima Qian himself explained in his Letter to Ren An: </P> <P> If even the lowest slave and scullion maid can bear to commit suicide, why should not one like myself be able to do what has to be done? But the reason I have not refused to bear these ills and have continued to live, dwelling in vileness and disgrace without taking my leave, is that I grieve that I have things in my heart which I have not been able to express fully, and I am shamed to think that after I am gone my writings will not be known to posterity . Too numerous to record are the men of ancient times who were rich and noble and whose names have yet vanished away . It is only those who were masterful and sure, the truly extraordinary men, who are still remembered...I too have ventured not to be modest but have entrusted myself to my useless writings . I have gathered up and brought together the old traditions of the world which were scattered and lost . I have examined the deeds and events of the past and investigated the principles behind their success and failure, their rise and decay, in one hundred and thirty chapters . I wished to examine into all that concerns heaven and man, to penetrate the changes of the past and present, completing all as the work of one family . But before I had finished my rough manuscript, I met with this calamity . It is because I regretted that it had not been completed that I submitted to the extreme penalty without rancor . When I have truly completed this work, I shall deposit it in the Famous Mountain . If it may be handed down to men who will appreciate it, and penetrate to the villages and great cities, then though I should suffer a thousand mutilations, what regret should I have? </P>

When was the letter to ren an written