Hi, I´m working with a code to call up files from a directory and save them in another folder with changes.
I have dta files for each quarter (years 2005-2018) and want to save them with a few changes before doing appending them.
Problem: when I run the code it gets me the error:
I am working in a Windows 10 computer, however, when I run this code in a mac computer it works perfectly.
I made sure that the folder is the one with the dta files using the command cd
Also changed / for \ while using Windows 10.
Does anyone have any advice of what could be happening?
Thank you!
Eugenia
I have dta files for each quarter (years 2005-2018) and want to save them with a few changes before doing appending them.
Code:
foreach y in 05 06 07 08 09 10 11 12 13 14 15 16 17 18 { forval q=1/4 { capture use "$od\sdemt`q'`y'.dta", clear destring n_ent, replace capture gen year=20`y' capture gen quarter=`q' save "$prd\sdemt`q'`y'.dta", replace } }
no variables defined.
I made sure that the folder is the one with the dta files using the command cd
Also changed / for \ while using Windows 10.
Does anyone have any advice of what could be happening?
Thank you!
Eugenia
Comment