Hi all,
These 2 codes below give me the same results.
What actually is preloadfmt here spposed to do?
What difference is supposed to make?
proc summary data=mylib.testo completetypes chartype ;
class sex/preloadfmt ;
var height weight;
output out=new max=/autoname;
format sex $gender.;proc print;run;
proc format ;
value $gender 'F'='Female'
'M'='Male'; run;
VS.
proc summary data=mylib.testo completetypes chartype ;
class sex ;
var height weight;
output out=new max=/autoname;
format sex $gender.;proc print;run;
proc format ;
value $gender 'F'='Female'
'M'='Male';
run;
You need to create the format before you use it.
PRELOADFMT allows you to use the format to create something from nothing. As a test add a level to the 'X'='OTHER' and see what happens.
You need to create the format before you use it.
PRELOADFMT allows you to use the format to create something from nothing. As a test add a level to the 'X'='OTHER' and see what happens.
sorry,what you mean by create the format before you use it?
I already had a format below my code.
So yes, with preloadfmt "other" appears in my result eventhough 'X' is nowhere in my inputted data but then why worry about "x" or anyhting that is not in my data?
oh so you are saying in case we want to show a classification level in the outputs that is not in the data then we use prleoadfmt?
One use, also preloadfmt works in some procedures such as Tabulate that do not have completetypes (actually no types). Completetypes only works in proc means or summary.
thank you both
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.