But this should be okay then?
%let testA=("A1" "A2" "A3");
%let testB=("B1" "B2" "B3");
data NEED;
set HAVE;
array cond_testA {20} VAR_1-VAR_20;
do i=1 to dim (cond_testA);
do j=1 to countw('&testA.', ',');
if (cond_testA {i} in &testA.) then do;
testA=1;
end;
end;
end;
array cond_testB {20} VAR_1-VAR_20;
do i=1 to dim (cond_testB);
do j=1 to countw('&testB.', ',');
if (cond_testB {i} in &testB.) then do;
testB=1;
end;
end;
end;
run;
The problem only arises with &&&var..? Sorry I'm still confused. I'm coming from stata where it's super easy to loop through strings.
... View more