Below is my code, still does not work. by the way, if i use "%if &i in (2,4,6,8,10,18) %then %do;" instead of %if &i =2 or &i=4 or &i=6 or &i=8 or &i=10 or &i=18 %then %do; the code produces some errors. options mprint ; proc report data=a; column trt visno, (param, (flg value )); define trt / group; define visno / across; define param / across; define flg / display; compute value ; %macro flg; %do i=2 %to 18; %let k=%eval(&i+1); %if &i =2 or &i=4 or &i=6 or &i=8 or &i=10 or &i=18 %then %do; %put &i &k; if _c&i._=1 then call define(_c&k._,"style","style=[background=yellow]"); if _c&i._=2 then call define(_c&k._,"style","style=[background=orange]"); if _c&i._=3 then call define(_c&k._,"style","style=[background=red]"); %end; %end; %mend; %flg; endcomp; run;
... View more