Tuesday, November 17, 2009

To list ALL using PRELOADFMT

The option PRELOADFMT is available only with Proc MEANS, Proc REPORT and Proc TABULATE.
To include all ranges and values of the user-defined formats in the output, the 3 Procs give out different usages.
Below are the samples for that.

proc format;
value $sex
'M' = 'Male' 'F' = 'Female' 'O' = 'Other';
run;

proc means data=sashelp.class completetypes mean;
format sex $sex.;
class sex / preloadfmt;
var height;
run;

proc report data=sashelp.class completerows nowd;
format sex $sex.;
column sex height;
define sex / group preloadfmt;
define height / analysis mean;
run;

proc tabulate data=sashelp.class ;
format sex $sex.;
class sex / preloadfmt;
var height;
tables sex*height*mean / printmiss;
run;

No comments: