Please help to write foreach loop correctly. The following produces an error 'variable var not found'
while code like this works
Code:
foreach var of varlist V9 V12 V17 { replace var = var[.] if var == 9 | var == 8 }
Code:
replace V9 = V9[.] if V9 == 9 | V9 == 8 replace V12 = V12[.] if V12 == 9 | V12 == 8 replace V17 = V17[.] if V17 == 9 | V17 == 8
Comment