I would like to use local date macros to create date-stamped file names for my log files and datasets. Creating them seems to have been straightforward so far, using the code below:
Code:
**create local date macro for naming files di "$S_DATE" local date = daily("$S_DATE", "DMY") di "`date'" di %tdCY-N-D 20418 local date : di %tdCY-N-D daily("$S_DATE", "DMY") di "`date'" save studyinfo_`date'.dta, replace
Code:
use studyinfo_`date'.dta, clear
(I have a feeling there is a simple answer to this but have struggled to find one online, partly I think because the question involves the ubiquitous term "use"...)
Thanks very much
Emily
0 Response to Local macros & "use" command
Post a Comment