Hi,
I'm looking to redesign my STATA do file processing to be more scalable. I have one main.do file which calls a series of other do files. However, I want these to operate on a separate folder.
i.e.
U:/data/scripts/main.do:
include prepdata.do
include analysedata.do
include outputresults.do
....
There are 50+ scripts being called in this do file.
The data that is being processed lives in a separate directory:
U:/data/dump/12-07-2019
I've tried simply updating the start of main.do to switch directories
i.e.
U:/data/scripts/main.do:
cd "U:/data/dump/12-07-2019" //there is a script here which finds the right date and then sets this directory
include prepdata.do
include analysedata.do
include outputresults.do
....
However, once it sets the current directory to U/data/dump/12-07-2019, it then tells me it can't find prepdata.do. This makes sense, since this script lives in the U:/data/scripts/ folder.
I've debated updating each do file, to switch to the dump directory at the start of it and then switch back to the scripts directory once completed, but this definitely doesn't seem like the best solution or scalable for the operations.
As such, how can I have all my scripts live in this folder, and all call & process data within another folder?
Thanks
Related Posts with Executing multiple do files with data in another directory
Calculate gini coefficient panel data using population of income groups and median income of said groupsHi, I have data containing the population of certain income groups and the median income of those i…
Relative change score as dependent*variable in Diff-in-DiffDear researchers, This is not a question regading Stata, but rather a more general one. I have seen…
Combine 2 Kaplan-Meier plots, not as 2 panels but in the same plotDear Statlist, I am trying to make a Kaplan Meier Plot showing survival up to 100 days for all pati…
How to combine two variables to create a new one?Hello, I am working with a dataset with merged data from 2 survey rounds (2005 & 20011). The f…
Opening upspecified file extensionDear members, I would like to know if it is possible to open an unspecified file extension using ST…
Subscribe to:
Post Comments (Atom)
0 Response to Executing multiple do files with data in another directory
Post a Comment