the code of mikezeb could be modified with do over as below , please try . hope it helps data new; set old; array lvl lvl1-lvl3; array adj adj1 - adj3; array q1 _q1-_q3; array q3 _qs1-_qs3; do over lvl; if adj(i) <= q1(i) then lvl(i)=1; else if q1(i) < adj(i) < q3(i) then lvl(i)=2; else lvl(i)=3; end; run; Thanks, Jag
... View more