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
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;
Does that make sense ?
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,
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!
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.