The SAS Output Delivery System and reporting techniques

compute statement in proc report

Reply
Regular Contributor
Regular Contributor
Posts: 170

compute statement in proc report

Hello all;
Hope everyone had a good holiday.
Question when using a compute statement-
So I have a define statement that dictates specific colors based on a specific compliance rate-
such that:
DEFINE FYTD1 /"FYTD" format=percent10. style={background=colors.};

But then I have one row that is not a percentage but rather a number that I would like to calculate as an actual integer-

So right now-420 becomes 42000%.
I managed to solve the background color issue but how do I fix the other problem-
So far I have tried:

compute FYTD1;
if _name_= 'Number Overall Observations' then do;

call define (_col_, 'style','style={background=white}');
call define (_col_, 'format','format=8.2');

end;
endcomp; */

Any suggestions would be much appreciated-Thank you.
LB
SAS Super FREQ
Posts: 8,745

Re: compute statement in proc report

Hi:
The percent format does an automatic multiply by 100. Not what you want. But I think you just have the syntax of the CALL DEFINE for format wrong. Try this:
[pre]
call define (_col_, 'format','8.2');
[/pre]
(without the format=)

cynthia
Regular Contributor
Regular Contributor
Posts: 170

Re: compute statement in proc report

Cynthia;
That worked. Thank you.
LB
Ask a Question
Discussion stats
  • 2 replies
  • 118 views
  • 0 likes
  • 2 in conversation