BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
style=[background=orange font_weight=bold] in the compute block is not being applied. Any suggestions?
Thank you.

proc report data=org nowd contents="Claims"
style(header)=[font_weight=bold];
options missing='0';
column department div tot_osha;
define department /group 'Customer Service' width=18 style(column)={just=l} order=data;
define div / group noprint;
define tot_osha / 'Total' style(column)={background=gold};
compute department;
if div in (1,6,7,8,9,10) then call define(_row_,"style","style=[background=orange font_weight=bold]");
endcomp;
where mdoi=1;
run;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
As discussed in these previous forum postings, PROC REPORT builds a report row from LEFT to RIGHT, based on the order of the variables in the COLUMN statement.
http://support.sas.com/forums/thread.jspa?messageID=36032賀
http://support.sas.com/forums/thread.jspa?messageID=9483┋
http://support.sas.com/forums/thread.jspa?messageID=24350弞

So, given your COLUMN statement,
[pre]
column department div tot_osha;
[/pre]

When PROC REPORT is putting DEPARTMENT on each report row, it has no visibility of the value for the DIV item, because DIV has not been placed on the report row yet. So you cannot use DIV in the compute block for DEPARTMENT. There's no reason, since DIV is a NOPRINT item that you couldn't swap the order of the two items in the COLUMN statement -- unless that would mess up the ordering of the rows.

Or, you could just do your CALL DEFINE in a COMPUTE block for DIV -- you can style a row and have a COMPUTE block for a NOPRINT column.

cynthia

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 759 views
  • 0 likes
  • 2 in conversation