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
-reshape- is doing something weird, when I go wide, and then back to long, I do not end up with the same dataset.Consider starting from the following dataset: Code: Code: * Example generated by -dataex-. To i…
Stata automatically reversed my dataHi all, Can anybody help me out how I can prevent STATA from reversing the data of aut3? Students f…
dividing the dataset in 2 grouphello, I want to divide my data set into an intervention and control group but i don't know how …
Generate new variableHey, in the panel study I am working with, there are two times the same variable (t34005a & t34…
Help with intuition of interaction-time effects in panel dataI am working on a panel dataset for a project which comprises 5 survey rounds. I have test score dat…
Subscribe to:
Post Comments (Atom)
0 Response to Executing multiple do files with data in another directory
Post a Comment