The SAS Output Delivery System and reporting techniques

proc report compute block style

Reply
Regular Contributor
Posts: 199

proc report compute block style

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;
SAS Super FREQ
Posts: 8,862

Re: proc report compute block style

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
Ask a Question
Discussion stats
  • 1 reply
  • 166 views
  • 0 likes
  • 2 in conversation