If you're a brahmin, you're probably familiar with the following mantra (see page 2):
Yajnopavitam, paramam pavitram
Prajapatim yatsahajam purastath |
Ayushyam agriyam pratimunja subhram
Yajnopavitam balam astu tejah ||
Put on the sacred thread, the supreme purifier, which was born along with Brahma long ago, which bestows long life, preeminence, and purity may the sacred thread bestow strength and light.
This is the mantra you say when you put on the sacred thread, variously called the Yagnopavita, Poonal, or Janayu. Brahmins change their sacred thread every year in a ritual called Avani Avittam or Upakarma, which took place this month.
My question is, what scripture does this mantra come from? The preamble you're supposed to say beforehand provides some detail about the mantra:
Yajnopavita dharana mahamantrasya, Brahmarishihi, Thrishtupchandaha, Trayi Vidyadevata, Yajnopavita dharana viniyogaha
Of the great mantra called the wearing of the sacred thread, the sage [who heard it from the gods] is Brahma, the meter is Trishtup, the deity [whom it's about] is the triple wisdom [i.e. the three Vedas], the purpose is the wearing of the sacred thread.
It might seem strange that the sage who heard this mantra from the gods is the god Brahma, but there are actually many verses in the Vedas which were heard by various gods. (See the Anukramani for Rig Veda Book 10 in my answer here; hymn 14, for instance, was heard from the gods by Yama the god of death, called Yama Vaivasvata in the Anukramani, and hymn 121 was heard by Brahma, called Hiranyagarbha Prajapatya.)
In any case, in what scripture does this mantra heard by Brahma occur? Also, on a side note are there any scriptures that describe how the sacred thread was originally "born along with Brahma", as the mantra says?