Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65570

What is the best way to tie a data file to a do file?

$
0
0
I usually have my data file in the same project directory as the do file. And I execute the do file normally via
Code:
do "/full/path/to/the/project/directory/mydofile.do"
How can I load the data file in my do file without knowing the absolute path reference to the data file? I tried
Code:
use "./mydatafile.dta"
but this doesn't work reliably, because the current working directory is not set to the directory the do-file is in.

What's the best way to deal with this to make project folders portable in the file system and between machines?

Many thanks for all suggestions.


Viewing all articles
Browse latest Browse all 65570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>