BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
newboy1218
Quartz | Level 8

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;
1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

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;

View solution in original post

4 REPLIES 4
noling
SAS Employee

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

novinosrin
Tourmaline | Level 20

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;
novinosrin
Tourmaline | Level 20

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;
newboy1218
Quartz | Level 8
Thank you it works!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 8047 views
  • 0 likes
  • 3 in conversation