BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Whitlea
Obsidian | Level 7

Hi, 

Does anyone have any advice on how I can get my proc tabulate to use the formats I assigned in the code? I have tried a few different things and have been unsuccessful. I would like my count column to use format comma10.0. and my cost column to use format dollar12.. Thank you!

data My_data;
 set Data;
 format count comma10.0 cost dollar12.;
 run;

Proc tabulate data=My_data;
class type Year /order=data ;
var cost count;
table type='Type'*Year="SFY",cost="Cost" count="Count" /printmiss
rts=32 ; 
format count comma10.0 cost dollar12.;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

You should be able to set the formats in the TABLE statement itself, just use *F=.

Example:

proc tabulate data=sashelp.class;
  class sex;
  var age height ;
  table sex,age*sum*f=10. height*mean*f=5.2 ;
run;

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

You should be able to set the formats in the TABLE statement itself, just use *F=.

Example:

proc tabulate data=sashelp.class;
  class sex;
  var age height ;
  table sex,age*sum*f=10. height*mean*f=5.2 ;
run;
Whitlea
Obsidian | Level 7
This worked! Thank you!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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