BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
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
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia;
That worked. Thank you.
LB

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 769 views
  • 0 likes
  • 2 in conversation