Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

[no subject]



local date=c(current_date)
log using "`path'\logs\progamlog `date'.smcl", replace

Friedrich Huebler

--- "Rio, Martin" <[email protected]> wrote:
> Is there a way to reference "today"'s date in Stata, where "today"
> is the
> current day based either on the computer's clock or some Stata
> clock?
>
> The reason why I wonder this is that I frequently run a code that
> saves its
> log in a log folder, and I would like to have each log file called
> differently to automatically keep previous logs. It would be nice
> to be able
> to replace the statement:
>
> log using "`path'\logs\programlog.smcl", replace
>
> with:
>
> log using "`path'\logs\progamlog [today].smcl", replace
>
> where [today] would be a function that returns today's date so that
> it
> becomes part of the log's file name.
>
> Other suggestions that achieve the same purpose are also welcome.
>
> Thanks in advance for any help.
>
> Mart�n Rio
> Charles River Associates
> Washington, DC
> phone:	(202) 662-3957
> fax:	(202) 662-3910





*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index