The conversation between yama and his sister Yami (Yamunā) is phenomenal. Found in Rgvéda and other shruti-smRti-itihāsa-purāNa texts too
Due to this comversation, yama is conferred the title of dharma-rāja.
Warning : heavily influenced by Indology
kalchiron.blogspot.com/2012/04/brief-…
The mahāpragnāvāna asura father that yama speaks to yami is surya. Surya is called hiraNyahasto asurah in various places.
He upholds dharma. He is a lokapāla
He narrated the sacred knowledge of kaTHa-upanishad to nachikétā. He taught us about shrèyas and prèyas.