Hello everyone,
I'm using the ODS to create an excel report with alternating colors for rows.
I'm now trying to get a row to change color based on a returned value within the row.
if job_rc = 4 then yellow/orange.
Any suggestions to point me in the right direction of adding this functionality?
Regards,
Jonathan
ods excel file= "/folders/myfolders/report.xlsx" ;
proc report data=sashelp.class nowd ;
column name age;
define name/ "" display style={cellwidth=2.5in};
define age/ "" display style={cellwidth=2.5in};
compute age;
if age le 14 then
call define(_row_,"Style","Style={background=yellow}");
endcomp;
run;
ods excel close;
How are you creating your report. What ODS destination are you using?
Please post your code.
The quick answer is proc report with a compute column - search for papers on the topic.
ods excel file= "/folders/myfolders/report.xlsx" ;
proc report data=sashelp.class nowd ;
column name age;
define name/ "" display style={cellwidth=2.5in};
define age/ "" display style={cellwidth=2.5in};
compute age;
if age le 14 then
call define(_row_,"Style","Style={background=yellow}");
endcomp;
run;
ods excel close;
Hi,
ODS excel file= "~/YOURS.xlsx" ;
proc report data=DB.TABLE nowd ;
column name VALUE;
define CITY/ "" display style={cellwidth=3.0in};
define POPULATION/ "" display style={cellwidth=3.0in};
compute CITY;
if age LESS 50000 then
call define(_row_,"Style","Style={background=BLUE}");
end
comp;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.