Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: using current_ time to manage the log file

From   "Martin Weiss" <>
To   <>
Subject   st: RE: using current_ time to manage the log file
Date   Wed, 7 Jul 2010 19:27:28 +0200


loc name=subinstr("`c(current_time)'_`c(current_date)'.smcl", ":","",.)
loc name=subinstr("`name'", " ","",.)

cap log close
log using `name', replace
di in r "`r(filename)'"

Why does it need to be the filename? Just insert the date somewhere in the
body of the -log-.


-----Original Message-----
[] On Behalf Of G. Dai
Sent: Mittwoch, 7. Juli 2010 19:15
Subject: st: using current_ time to manage the log file

hi all,
I find it is difficult to trace back my research by looking at the log
files. Ideally, I'd like to name the
log file with the time the do file executes, e.g., the log file is
named as "10_25_7_July_2010" where 10_25 is the
time and 7_July is the date.
with this in mind, I'd like to  use
***************begin ******
log using "/.............../"`c(current_time)'_`c(current_date)'.smcl",
but failed because current_time have punctuation marks like ":" which
can't be included in a file name.

how you guys solve this problem?
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index