Long ago in the land of Jambudvip, there was a city called Kamalapur. The king of that city was named Saharaksa. One day, in the king's court came an astrologer. The king asked the astrologer if he knew what was going to happen in the future. The astrologer did not say a word. The king asked him second time. He told the king, "A severe famine is going to break out and it will wipe out the entire city."
The king did not like what he heard. He called his ministers and asked them to work out a plan where they could save the people. The ministers suggested that they should buy as much grain as possible. The king emptied his treasury and bought as much grain as he could. He stored the grain for bad days to come.
Later, in the month of Ashadh (June-July), the sky was covered by dark clouds. The king looked up at the sky, and thought it would rain. These and subsequently other clouds brought enough rain for people to grow good crop. In a way king was happy for the people but at the same time he was puzzled why astrologer's forecast turned out wrong.
A few days later, the king's gardener came to the king with a message. The message was that a Jain Muni would like to stay in his royal park for the monsoon period. The muni was a Kevaljnai (omniscient), one who knows past, present and future, all at the same time.
The king rewarded the gardener for the message, and asked the people of the city to welcome the sage. The king went to visit the muni and listened to his holy words. The king then asked, "How could the words of the astrologer not be true?"
The muni told the king, "The famine was averted because of the birth of a pious soul in your city. The astrologer did not know that."
The king asked him to tell about the previous life of this pious soul.
The muni stated. "In the land of Bharat, there was a city called Purimatala. In the city, there was a rich man, who suddenly became sick. He tried his best to improve his health, but did not succeed. One day he met a monk and after listening to the sermon, he decided to give up his regular diet and only eat simple foods cooked without any spices or salt. He also decided to meditate regularly and observe celibacy. His health improved within a few days. His pledge grew stronger now, so he continued his diet, meditation, and celibacy.
Later, there was a famine in the city, and he used all his wealth to feed the people. This helped people to survive the famine. After he finished his life, he was reborn as a deva (heavenly angel) and from there, he was reborn in your city, as the son of a shravika named Subuddhi.
The king was very happy to hear this. He went to Subuddhi's house to pay respect to the pious soul. He saw the child and blessed him and gave him the name Dharmkumar (prince or son of religion).
When Dharmkumar grew up, he married a beautiful, religious, young woman. In his later years, he joined the holy order of monks and after performing austerities and meditation, he attained Kevaljnana and got liberated.