How to insert today's date into a log file name.
local path "C:\project1\"
log using `"`path'\logs\progamlog_`=subinstr("`c(current_date)'"," ","",.)'.smcl"', replace
if run today would create a log file named:
C:\project1\logs\programlog_4May2004.smcl
The subinstr function removes all the spaces.
The long way to do this would be:
local path "C:\project1\"
local today = subinstr("`c(current_date)'"," ","",.)
log using "`path'\logs\progamlog_`today'.smcl", replace
Dan Blanchette
The Carolina Population Center UNC-CH
st: Re: Today in a log file