I have started to include a header in my .do files that reads as follows:
The global macro $do shows the directory in which the .do file is located, assuming I have opened the .do file in a new STATA console window. If instead, I open and run various other programs within the console, and then open the file with this header, it does not have the c(pwd) set to the directory where this .do file came from. Is there any command I can use to reset STATA such that after running other programs, I can open this file in the same console and have the c(pwd) set to where the .do file is located? For example, if the command was called "reset cd", I could place it in the code as follows, and the code would then always assign the .do location directory as c(pwd):
Code:
clear macro drop _all set more off set type double global do = c(pwd)
Code:
clear macro drop _all set more off set type double reset cd global do = c(pwd)
Comment