Dear all,
I had a problem when doing a loop, the commands are as follows:
local max_ad 2
forvalues andate=1/`max_ad'{
replace event_time=0 if excel_date==ad`andate'
replace identifier=secid+`andate'/10 if excel_date==ad`andate'
replace final=1 if excel_date==ad`andate' & ad`andate'_fin==1
}
If always returns invalid syntax. But when I changed `max_ad' to 2, it can be processed.
Can somboby please tell me why this happens? And how can this be solved?
Thank you in advance!
Tanya
I had a problem when doing a loop, the commands are as follows:
local max_ad 2
forvalues andate=1/`max_ad'{
replace event_time=0 if excel_date==ad`andate'
replace identifier=secid+`andate'/10 if excel_date==ad`andate'
replace final=1 if excel_date==ad`andate' & ad`andate'_fin==1
}
If always returns invalid syntax. But when I changed `max_ad' to 2, it can be processed.
Can somboby please tell me why this happens? And how can this be solved?
Thank you in advance!
Tanya
Comment