Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Get actual file name


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Get actual file name
Date   Tue, 5 Jul 2011 10:23:11 +0200

On Tue, Jul 5, 2011 at 10:09 AM, Renger van Nieuwkoop wrote:
> Is it possible to get the actual file name in Stata. I want to use this information to automatically name my log file? (so I can use this for every other file over and over again)
> E.g. something like:
> - Get actual file name   (for example : test.do), save it in a local macro "actual"
> - log using "actual"

Which file is the "actual" file? The data file, the do-file, the
master do-file that calls the do-file, the intermediate do-file that
is called by the master do-file and calls another do-file, etc.?

I would just define a global macro in the master do-file that defines
"the name" for your project (call it something like proj_name) and
derive the names for log file from that global (e.g.
${proj_name}_dataprep, ${proj_name}_descrip, ${proj_name}_analysis,
etc.).

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index