Hello
What does it mean Preloaded Formats ?
Does it mean that when I want to show also levels(categories) that have no rows in the row data then I need to use Preloaded Formats ?
When I use proc tabulate I see that sometimes using with class statement "preloadfmt " and sometimes "preloadfmt exclusive"? What is the difference? When should we add the word exclusive?
When do we use the option "notsorted" in user defined proc format?
Is it in order to sort the levels (rows) in summary report by the order of left side values in proc report?
I see that when we use "notsorted" option then we use also "order=data" in class statement of proc tabulate. Why should we use them together(notsorted and order=data)??
Hi Ronein,
The prefloadfmt option to display all the modalities defined in the format, even if they are not observed in your input dataset.
With the exclusive option, you tell SAS to display all the modalities defined in the format AND not to remove from display the observations with a value that has not been defined in the format.
E.g.
proc format;
value sex 0="Male" 1="Female";
run;
data have;
input sex;
format sex sex.;
datalines;
0
0
0
3
;
run;
title "Without preloadfmt option";
proc tabulate data=have;
class sex;
table sex*n='';
run;
title "With preloadfmt option";
proc tabulate data=have;
class sex / preloadfmt;
table sex*n='' / printmiss;
run;
title "With preloadfmt and exclusive options";
proc tabulate data=have;
class sex / preloadfmt exclusive;
table sex*n='' / printmiss;
run;
I suggest that you study the documentation for the CLASS Statement in PROC TABULATE, and the example that is linked in the description of the EXCLUSIVE option.
Hi Ronein,
The prefloadfmt option to display all the modalities defined in the format, even if they are not observed in your input dataset.
With the exclusive option, you tell SAS to display all the modalities defined in the format AND not to remove from display the observations with a value that has not been defined in the format.
E.g.
proc format;
value sex 0="Male" 1="Female";
run;
data have;
input sex;
format sex sex.;
datalines;
0
0
0
3
;
run;
title "Without preloadfmt option";
proc tabulate data=have;
class sex;
table sex*n='';
run;
title "With preloadfmt option";
proc tabulate data=have;
class sex / preloadfmt;
table sex*n='' / printmiss;
run;
title "With preloadfmt and exclusive options";
proc tabulate data=have;
class sex / preloadfmt exclusive;
table sex*n='' / printmiss;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.