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

st: Today in a log file


From   "Rio, Martin" <[email protected]>
To   [email protected]
Subject   st: Today in a log file
Date   Mon, 3 May 2004 16:28:17 -0400

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

> ************************************************************************
> This electronic message contains information from the consulting firm of
> Charles River Associates Inc., which may be confidential or privileged.
The
> information is intended for the use of the individual or entity named
above.
> If you are not the intended recipient, be aware that any disclosure,
copying,
> distribution or use of the contents of this information is prohibited.  If
you
> have received this electronic transmission in error, please notify us  by
> telephone (617 425-3582) or by e-mail ([email protected]) immediately.
> ************************************************************************
> 

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