Context: I am working with confidential data, which requires me to log all of my commands and the output in a log file. They will not check my do files, just the logs.
This used to work fine until they upgraded to STATA17. I am not sure why, but the log files do not log my commands anymore. Comments and output yes, commands no.
Why is it happening? Is there a command to fix this?
Sample code below
I want it to print everything, but the output from the log file is
* ---------------------------------------------------------------------------
* Comments
* ---------------------------------------------------------------------------
Table One ---------------------------------------
[regression table]
Note how in order for it to print the comments in the log file I have to use the display (di) command. The actual commands, like rename, reg and use, are not recorded.
This used to work fine until they upgraded to STATA17. I am not sure why, but the log files do not log my commands anymore. Comments and output yes, commands no.
Why is it happening? Is there a command to fix this?
Sample code below
Code:
set more off foreach year in 1970 1980 1990 { capture log using "mylog.log", replace name(log_`year') di "* ---------------------------------------------------------------------------" di "* Comments " di "* ---------------------------------------------------------------------------" use "data`year'.dta", clear * Renaming variables rename thisvariable othername * di "Table One ---------------------------------------" reg y x [iweight=weight], r }
* ---------------------------------------------------------------------------
* Comments
* ---------------------------------------------------------------------------
Table One ---------------------------------------
[regression table]
Note how in order for it to print the comments in the log file I have to use the display (di) command. The actual commands, like rename, reg and use, are not recorded.
Comment