Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: Re: st: how to avoid absolute path names in do-files?


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: Re: st: how to avoid absolute path names in do-files?
Date   Tue, 22 Mar 2005 08:27:47 -0500

I wouldn't use local macros because they would need to be repeated in every do file (that's why they're called local), making it more difficult to change. Instead, I would assign the paths to global macros in a single small do file (mydirs.do), e.g.,

global data1dir "d:/projectdir/data1"
global data2dir "d:/projectdir/data2"
...

then I would either enter the command -run mydirs- in profile.do (as long as mydirs.do is in you default Stata directory, or else use a fixed path to point to it), or start each do file in the project with the command -run mydirs-, as long as all of the do files are in the same directory as the mydirs.do.

Michael Blasnik
michael.blasnik@verizon.net

*
* 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/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index