Hi all, I'm trying to run a loop using forvalues as in the following:
I define the
global before running the loop.
I get the following error
I'm not sure where the syntax has gone wrong. The file names are exactly as indicated in the loop: the actual file names are "4_2007_revised", "4_2018_revised" etc.
Would appreciate any help in this regard.
Thanks
Code:
forvalues `i'=0/1{
forvalues `j'=0/9{
capture noisily use "$temp\4_20`i'`j'_revised.dta"
capture noisily replace mandal_name="Am" if mandal_name=="Am Muncipality"
capture noisily replace mandal_name="An" if mandal_name=="An Muncipality"
capture noisily replace mandal_name="El" if mandal_name=="El Municipality"
capture noisily replace mandal_name="Sr" if mandal_name=="Sr Muncipality"
capture noisily replace mandal_name="De" if mandal_name=="Dev"
save "$temp\4_20`i'`j'_revised.dta",replace
clear
}
}
.
Code:
$temp
I get the following error
Code:
_= invalid name r(198);
Would appreciate any help in this regard.
Thanks

Comment