I don't know of any such built-in,
but I must be missing something. It
is surely about as much typing to do the
specific
di "example.do"
as to do this by some general code,
even if that existed.
Nick
[email protected]
Eddy
> Is there a built-in macro that register the name of the DO file that
> is currently running? I wish to use it to print the file name to the
> session log, so that when I looked at the log next time, I'll know
> which DO file was used to generate the results.
>
> That is, what I need is something like the (bogus) $FileName macro in
> the following example, which should take the value of "example.do"
> (with or without file path). Thus, when I open mylog.txt months
> later, I'll know it is the result of running example.do.
>
> ====== example.do ==========
> capture log close
> log using mylog.txt
>
> di "$FileName"
>
> .......
>
> ============================
>
> Forgive my ignorance if the question has been asked before -- I
> searched but couldn't find the answer.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/