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;
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;
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.