The SAS Output Delivery System and reporting techniques

ods pdf proc report compute block

Reply
Regular Contributor
Posts: 196

ods pdf proc report compute block

The image does not appear when I use this line of code in my compute block
"if per_osha11.sum<per_osha10.sum".
However, if I change this line of my compute block to
"if per_osha11.sum<20"
the image shows up.
I'm using ods pdf to output this table.

Any ideas?
Thank you.

proc report data=task_tot5 nowd contents="Claims" out=test
style(header)=[font_weight=bold background=CX90D9D7];
options missing='0';
column task1 tot_osha11 per_osha11 tot_osha10 per_osha10 ;
define task1 / 'Task';
define tot_osha11 / analysis "Total 2011 YTD" style(column)={cellwidth=1in};
define per_osha11 / analysis "% of 2011 YTD Total" style(column)={cellwidth=1.1in};
define tot_osha10 / analysis "Total 2010" style(column)={background=CXECEDEC cellwidth=1in};
define per_osha10 / analysis "% of 2010 Total" style(column)={background=CXECEDEC cellwidth=1.1in};
rbreak after / summarize;
compute per_osha11;
  if task1 notin ("other*") then do;
   if per_osha11.sum<per_osha10.sum then
   call define (_col_,'style','style=[preimage="C:\GreenArrowDown.gif"]');
  end;
  if _break_="_RBREAK_" then per_osha11.sum=100;
endcomp;
run;

PROC Star
Posts: 7,363

ods pdf proc report compute block

My guess would be that the two ten variables would have to come before the two 11 variables.  It would help if you could post all of the code and a sample dataset.

Super User
Posts: 9,687

ods pdf proc report compute block

Because in your column statement , per_osha11 is before per_osha10, but proc report calculated from left to right.So you need use

compute per_osha10;

to tell sas what the per_osha10'value is.

Ksharp

Ask a Question
Discussion stats
  • 2 replies
  • 172 views
  • 0 likes
  • 3 in conversation