Hi everyone,
I'm fairly new to STATA and this one practice problem has been driving me crazy...I would really appreciate any help...
I'm trying to create a local variable that lists only the “long name variables of more than 8 characters in a dataset
So far I have
foreach var of varlist *{
display "`var'"
if length("'var'")>8 {
}
}
Which generates an error message. I've tried several other configurations but none has worked. Any guidance would really be appreciated!
0 Response to Using if statements using foreach
Post a Comment