Hi all,
I have an issues in processing string.
I have a data set that includes some regions and a region has some data via year.
I use loop for processing data. However, I have a error. My code is :
local region_code "HN TH CT"
foreach region in `region_code' {
local year_code "2000 2001 2003"
foreach year in `year_code' {
local filename ""G:\Working""`region'""""`year'""""`region'""RT"" `region'""RT.DTA""
display `filename'
use `filename', clear
}
}
The result of display command is : G:\Working\HN\2000\HNRR\HNRR.DTA . But use command return an error : invalid '"HN' r(198).
I use : display “use `filename', clear” and the result is : use G:\Working""HN""""2000""""HN""RR""HN""RR.DTA", clear" invalid name
I gues the “filename” variable is: G:\Working\””HN””\””2000””\””H N””RR\””HN””RR.DTA, so I get an error use command.
Why is the filename different between filenam in display command and use command ?
Could you help me to resolve the problem please .
Hut
Related Posts with Errror in process string
Lincom test Weibull analysis with dummyXdummy interactionDear all, I searched for the forum for a solution to my problem and tried some fixes already, the is…
Causal Inference and Exogenous VariablesHello, This is not a stata question per se, but an economics one and hope you would be able to offe…
xtabond2 - missing Wald Chi2 under nocons optionDear Statalist community, I am using Stata 13 and run xtabond2. When running xtabond2 with nocons o…
Proper display of foreign language (Arabic/Urdu - Right to Left) using Stata 16Hello everyone, Hope everything is well. I have come across this rather possibly minor problem whi…
Summing observations of a variable with if - conditionsHere diff has some estimate and for each observation - let's say if fyear = 2020, I need to calculat…
Subscribe to:
Post Comments (Atom)
0 Response to Errror in process string
Post a Comment