Hello,
Your tests are difficult to read and thus prone to mistakes. For instance, is oI_&x._t2_iea missing on purpose
or is it a copy/paste error ? By using arrays, you can make your code much more readable.
data have;
array OI OI_1_t1-OI_1_t4;
do _N_=1 to 100;
do over OI;
OI=floor(4*rand("Uniform")+1);
end;
output;
end;
run;
data want;
set have;
array OI OI:;
if 2 in OI or 4 in OI then OI_1=2;
else if 3 in OI then OI_1=3;
else OI_1=1;
run;
... View more