BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

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)??

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

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;

 

Capture d’écran 2020-05-02 à 13.58.49.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

View solution in original post

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

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;

 

Capture d’écran 2020-05-02 à 13.58.49.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 449 views
  • 1 like
  • 3 in conversation