!!!
I've solved the issue myself. Of course, no shenanigans involved on the side of Stata. Just the fact that, for some reason, I need to use both double quotes and `' for the cd command to work. Maybe someone could explain why this is? I thought you could access local macros without any single or double quotes?
!!!
Hello,
I've an incredibly weird problem that I cannot wrap my head around. I am new to Stata, so could be a stupid error, but I can't find anything of help online, on the cd documentation, nor with AIs.
Anyways. I've defined local macros of directories to cut down on typing and increase readability. These macros work with commands such as import delimited and save. However, they do not work with cd. In that case, I get the error r(170).
Here's the code of relevance:
Why does cd send out r(170) when deso_populationdata_directory clearly exists, is not protected, and is a directory? Could it be due to the fact that I'm working in a cloud environment?
Thank you!
I've solved the issue myself. Of course, no shenanigans involved on the side of Stata. Just the fact that, for some reason, I need to use both double quotes and `' for the cd command to work. Maybe someone could explain why this is? I thought you could access local macros without any single or double quotes?
!!!
Hello,
I've an incredibly weird problem that I cannot wrap my head around. I am new to Stata, so could be a stupid error, but I can't find anything of help online, on the cd documentation, nor with AIs.
Anyways. I've defined local macros of directories to cut down on typing and increase readability. These macros work with commands such as import delimited and save. However, they do not work with cd. In that case, I get the error r(170).
Here's the code of relevance:
Code:
clear cd local deso_populationdata_directory "/Users/theodorselimovic/Library/CloudStorage/OneDrive-Personal/Sciences Po/M2 Spring Courses/Advanced Panel Econometrics/Project/DeSo befolkning" foreach file of local mycsvfilelist { import delimited "`deso_populationdata_directory'/`file'", varnames(1) clear local outfile = subinstr("`file'",".csv","",.) save "`deso_populationdata_directory'/`outfile'", replace } cd deso_populationdata_directory
Why does cd send out r(170) when deso_populationdata_directory clearly exists, is not protected, and is a directory? Could it be due to the fact that I'm working in a cloud environment?
Thank you!
Comment