I would like to save the do file automatically each time I run it completely.
I have read this post and if I save the do file with the following script
when I open this file there is just gibberish in it--as discussed in the linked post.
Then, I found this Stata manual chapter, with further explanation in here.
Based on that information, this is how I write my do file:
Based on this script, I expect to find in "myfolder" a smcl file--generated with the log command--and a txt file--generated with the cmdlog command.
I correctly find both files.
However, the smcl reports anything as expected (i.e. both inputted commands and output), while the txt file is empty (i.e. 0kb)
When, I open this txt file is completely blank, while I would expect to find in there the commands I have inputted.
What is wrong with what I am doing?
Thanks in advance
I am using Stata\SE 14.2, Windows 10 Home
I have read this post and if I save the do file with the following script
Code:
save mydofile.do
Then, I found this Stata manual chapter, with further explanation in here.
Based on that information, this is how I write my do file:
Code:
cap cmdlog close cap log close local today: di %td_N-D-CY date(c(current_date),"DMY") cmdlog using "mypath\myfolder\Cleaning and analyses`today'.txt", replace log using "mypath\myfolder\Cleaning and analyses`today'", replace <my commands to Stata> cap log close cap cmdlog close
I correctly find both files.
However, the smcl reports anything as expected (i.e. both inputted commands and output), while the txt file is empty (i.e. 0kb)
When, I open this txt file is completely blank, while I would expect to find in there the commands I have inputted.
What is wrong with what I am doing?
Thanks in advance
I am using Stata\SE 14.2, Windows 10 Home
Comment