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
Use of ppml in gravity modelDear Statalisters, I am trying to use the gravity model to study the impact of implementation of TRI…
HLM - Level 1 Sample Size within sub-groupsHello, I am planning to fit an HLM model predicting the odds of HIV risk behavior among people who …
estat sarganHi experts, I tried to run estat sargan and estat abond but each time an error is generated "invalid…
Multencode: New Variables QuestionHello, I've been trying to synchronize value labels from multiple surveys. I first decoded all nume…
Number of observations per coefficientHello Statalist, A reviewer recently asked for a column that lists the number of observations in ea…
Subscribe to:
Post Comments (Atom)
0 Response to Executing multiple do files with data in another directory
Post a Comment