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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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