Hi Everyone,

I have difficulty to cd the file to Dropbox and use the file in Dropbox. Here are my steps:

1. I use "global" to define the files directories, this is one of the related "global" I used, and this step is absolutely right.
Code:
global output "$version/Datasets"
2. I forgot I already define the folder directory, and I define it again and run the following commands:
Code:
global path1 "$output"
global path2 "$output/two-surveys panel datasets"
cd "$output"
use "$output/Master individual dataset.dta", clear
"path1" is just the same as step 1, I define the folder directory "$ouput" again
"path2" is where I want to put the datasets

Until now, the commands "cd" and "use" work well at this time, I get the results I want.

3. Then, I find I miss some commands in the do file, and find I "global" the "$ouptput" twice,
so I add the commands to the loop part and remove the command: global path1 "$output"

4. I run the do file again to see if the newly added commands work, but this time, the "cd" and "use" commands do not work. Here is the Stata output:
Code:
.
. *global path1 "$output"

. global path2 "$output/two-surveys panel datasets"

. cd "$output"
unable to change to /Mitacs/Analysis/Datasets
r(170);

. use "$output/Master individual dataset.dta", clear
file /Mitacs/Analysis/Datasets/Master individual dataset.dta not found
r(601);

I did not change anything for the commands "cd" and "use" part; I always remember to run the "global" first, and the "global" is absolutely right; the file names are right, and no blank space in the file names.

The commands "cd" and "use" just does not work after I add some commands in my loop part.

Does anyone have an idea about what happened?



Thanks!
Bingbin Li