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