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