1)
data class;
set sashelp.class;
length x $ 80;
if age in (11:14) then x=cats('(*ESC*){style [foreground=yellow fontsize=2 fontweight=bold]||||||||}age_',age);
else x=cats('(*ESC*){style [foreground=red fontsize=2 fontweight=bold]||||||||}age_',age);
keep name age x;
run;
ods excel file='c:\temp\temp.xlsx';
proc report data=class nowd ;
run;
ods excel close;
2)
data class;
set sashelp.class;
length x $ 80;
y='||||||||'; x=cats('age_',age);
keep name age y x;
run;
ods excel file='c:\temp\temp.xlsx';
proc report data=class nowd ;
column name age y x;
define age/display;
compute y;
if age in (11:14) then call define(_col_,'style','style={background=yellow foreground=yellow}');
else call define(_col_,'style','style={background=red foreground=red}');
endcomp;
run;
ods excel close;
... View more