The following commands are fickle, not reliable, working sometimes and not at others. I use a project file, containing the specific do file with the script I am trying to run.
I work on a PC.
global macro project1_data "C:\Users\...\Datasets"
display "${project1_data}"
use "${project1_data}mysamplingdata", clear
However, the code does not seem to register, and I am told:
use "${project1_data}mysamplingdata", clear
file mysampling.dta not found
r(601);
Also, when I type in:
cd "${project1_data}"
This gives me the current directory. The project file is in a different directory.
Do I need to modify the global macro script above because of that?
Thanks,
Saul
Related Posts with Global macro for a directory using project file
Merge data sets and keep specific observationsDear all, I have a problem merging two panel data sets (one data set with ESG Scores for firms and …
Using matchit commandDear all I am working with crop productivity data from Bangladesh and attempting to identify observ…
PSM help: using observation # stubs to generate dummiesHi All. I’d love some help with the PSM dataset I’m constructing. I’ve already established overlap a…
stset use with multiple records per personHi, I'm relatively new to Stata and am trying to set up some data for a Cox regression. I have abou…
How can i know the exact value for a number in STATA and replaceDear All I have a data set where I want to create a new variable using an existing variable with va…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro for a directory using project file
Post a Comment