Hi, I am trying to use proc means to see what is the missing rate for some variables in my dataset. I used the following code to generate an output dataset. However, I did not see "nmiss" column in my output. I somehow saw it when I opt-out the "noprint" option, and saw it in my output page. Does anyone know how I can make it appears in my output dataset too?
proc means data = infile n mean nmiss min max std nway;
class month;
var a b c d;
output out = outfile;
run;
And @newboy1218 For your example, you could use
ods output summary=outfile;
proc means data = infile n mean nmiss min max std nway stackodsoutput;
class month;
var a b c d;
run;
https://communities.sas.com/t5/General-SAS-Programming/Proc-means-output-out-statements/td-p/115741
Specify the statistics that you want in the output statement.
proc means data=yourinputdata youroptions ;
your class statement ;
your var statement ;
OUTPUT OUT=youroutputdataset NMISS= N= MEAN= MIN= MAX=;
run;
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Try ODS Output
Example:
ods output summary=_stat_;
proc means data = sashelp.class n mean nmiss min max std nway;
class sex;
var _numeric_;
run;
And @newboy1218 For your example, you could use
ods output summary=outfile;
proc means data = infile n mean nmiss min max std nway stackodsoutput;
class month;
var a b c d;
run;
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 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.