In my input dataset I do have a 28 variables which are corresponding to each other like Left10a, Right10a, Left11a, Right11a......................Left24a, Right24a. I need to compare its corresponding variables like Left10a & Right10a and create a new variable design10 by using do loop/arrary/something because tomorrow the maximum count of 24 may increase to 30. I tried with below code but its only working for single iteration which is i =10. Please help me how do loop have to work till 24 iterations. Also suggest me is there any other way I can do to create 14 new variables. Thanks for your time. data count; set count2; %let i = 10; do i = &i. to 24; if left&i.a ne "" and righ&i.a ne "" then do; if left&i.a ^= righ&i.a then design&i. = "NOT EQUAL"; else if left&i.a = righ&i.a then design&i. = "EQUAL"; end; %let i=%eval(&i + 1); end; run; Regards, Kumar.
... View more