BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

What is the difference between using "MLF" and using "MLF preloadfmt" ?

As I know MLF option is telling SAS that format of class variable is multi label.

What is the purpose of preloadfmt?

IS always preloadfmt going together with MLF?

But as I see MLF can go alone without preloadfmt 

 

 

 

3 REPLIES 3
ed_sas_member
Meteorite | Level 14

Hi @Ronein 

 

Multilabel formatting allows an observation to be included in multiple rows or categories -> with the MLF option (and if the procedure supports it like PROC MEANS for example), you activate multilabel format processing when a multilabel format is assigned to a class variable.

 

Preloadfmt is quite different. The objective is to take into account all modalities of a variable. For example, if you run a PROC TABULATE on a dataset that contains data for female only, and that you apply this option as well as the PRINTMISS option, you will tell SAS to display all modalities (male, female) and not only observed modalities. Another example could be countries. If your dataset contains observations for 2 countries, but the format specifies values for all countries over the world, you will be able to build a report with all modalities, even if they have actually no observation in the dataset.

 

E.g.

proc format;
	value sex (multilabel) 0="Male" 1="Female" 0,1 = "All";
run;

data have;
	input sex;
	format sex sex.;
	datalines;
0
0
0
;
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 mlf option";
proc tabulate data=have;
	class sex / preloadfmt mlf;
	table sex*n='' / printmiss;
run;

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Does that make sense ?

Ronein
Meteorite | Level 14
Thank you for perfeft explanation.
Is Preloadfmt always go together with printmiss ?
ed_sas_member
Meteorite | Level 14

Hi @Ronein 

Yes, PRELOADFMT must be used with:

- PRINTMISS option in PROC TABULATE to include all the modalities of formats in the summary table, even if in case of a zero frequency 

- EXCLUSIVE option if you want to restrict the display of some modalities.

Best,

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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