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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.