Hi There, I am having set of variables (trt01 - trt07) having character values , i need to find maximum non missing treatment from 7 treatments group.i need to use that last 2 digit number in a macro variable. trt01 trt02 trt03 trt04 1 abc def -----------> trt03 2 abc -----------> trt01 3 abc def ght dsa ------------> trt04 instead of writing group of if then else statement any other dynamic way to find treatment ,any one help me please. data d2;
set d1
array trt(7) $12.;
array trt_n(7);
do i = 1 to dim(trt);
trt_n(i)= ^missing(trt(i));
x = max(reverse(substr(cmtrt_atcn(i),1,2))); L_trt = trt||x;
end;
run;
... View more