Hello
I am using proc summary with proc format.
Why .='Total' is not working?
In the output I want to get Total row with value 'Total' but I get it with null value
proc format library=work;
value OverLapFmt (multilabel)
low - 60 = 'Until 60'
55 - 70 = '55--70'
65 - high = '65 and Up'
.='Total'
;
run;
proc summary data=sashelp.class sum ;
class height / mlf;
var weight;
format height OverLapFmt.;
output out=want sum=sum;
run;
Please try
proc format library=work;
value OverLapFmt (multilabel)
low - 60 = 'Until 60'
55 - 70 = '55--70'
65 - high = '65 and Up'
Other='Total'
;
run;
Please try the below code, also i removed the mlf option used in proc summary.
proc format library=work;
value OverLapFmt (multilabel)
low - 60 = 'Until 60'
55 - 70 = '55--70'
65 - high = '65 and Up'
Other='Total'
;
run;
proc summary data=sashelp.class sum ;
class height ;
var weight;
format height OverLapFmt.;
output out=want sum=sum;
run;
Are you trying to include missing values of the CLASS variable in your analysis?
If so you need add the MISSING option on either the PROC statement or the CLASS statement.
Perhaps this was what you intended:
proc format library=work; value OverLapFmt (multilabel ) low - 60 = 'Until 60' 55 - 70 = '55--70' 65 - high = '65 and Up' low-high='Total' ; run; proc summary data=sashelp.class sum nway; class height / mlf; var weight; format height OverLapFmt.; output out=want sum=sum; run;
Note that you are going to have a lot of fun trying to get specific order of the formatted values.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.