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;
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.
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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.