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
Code:
cd
Does anyone have any advice of what could be happening?
Thank you!
Eugenia
0 Response to Problem with modifying dta files from directory I get the error: no variables defined
Post a Comment