Dear all,
Usually, when writing a do file, the first lines are like this:
clear
set mem..
set more off..
cd c:/project/data // !!!!!!
The problem is that, when using the do files on different computers,
or giving the data + do-files to a colleague, they have to change each
do-file to match the location of the data (ie, change cd
c:/project/data to cd "c:/my documents/john/reviews/data")
My question is, is there a way to do something like
cd `currentdofile'
Where `currentdofile' gives the path to the do file currently running.
Assuming that the do files are in a folder like c:/project/prg , then I can
cd ..
cd data
And I don't longer have to update locations if the path changes.
I'm aware that other languages do this, but i don't know if there is
any way to do this in Stata.
Thanks,
Sergio
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/