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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 806 views
  • 0 likes
  • 2 in conversation