SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Whitlea
Obsidian | Level 7

How can I format my percent in this proc freq?  I have tried every percent variable name I can think of  and non of them work. If "Percent" is printed in the table being generated, why is it telling me there is no percent variable? 

 

 

PROC FREQ DATA=data ;
TABLE Program*Award / nocol norow;
label Program='Program Type';
label Award='Amount Awarded';
format award dollar10. Percent f5.1 ;

RUN;

 

 

1 REPLY 1
Reeza
Super User

PROC FREQ doesn't support formatting easily. I would recommend using PROC TABULATE instead, but you'll have to manually specify the percentages which is annoying as well.

 


@Whitlea wrote:

How can I format my percent in this proc freq?  I have tried every percent variable name I can think of  and non of them work. If "Percent" is printed in the table being generated, why is it telling me there is no percent variable? 

 

 

PROC FREQ DATA=data ;
TABLE Program*Award / nocol norow;
label Program='Program Type';
label Award='Amount Awarded';
format award dollar10. Percent f5.1 ;

RUN;

 

 



 

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1 reply
  • 645 views
  • 0 likes
  • 2 in conversation