BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

PROC MEANS DATA=final_row NWAY ;

  CLASS mco agegroup gender RiskGroup ;

/*  VAR metric ;*/

  OUTPUT OUT=final N=cnt ;

RUN;

by commenting out the var statement there is no output dataset created.But how to create an outputdataset

3 REPLIES 3
Hima
Obsidian | Level 7

Tested on one of my data set and working fine

PROC MEANS DATA = TMP39 NWAY;
CLASS FEE;
OUTPUT OUT=FINAL N=CNT ;
RUN;

PROC PRINT DATA = WORK.FINAL;
RUN;

NOTE: There were XXXXX observations read from the data set TMP39.

NOTE: The data set WORK.FINAL has 2 observations and 4 variables.

NOTE: Compressing data set WORK.FINAL increased size by 100.00 percent.

      Compressed is 2 pages; un-compressed would require 1 pages.

NOTE: The PROCEDURE MEANS printed pages 45-56.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           40.04 seconds

      user cpu time       25.06 seconds

      system cpu time     1.20 seconds

      Memory                            2402k

      OS Memory                         9508k

      Timestamp            4/03/2012  3:40:09 PM

      Page Faults                       0

      Page Reclaims                     314

      Page Swaps                        0

      Voluntary Context Switches        3500

      Involuntary Context Switches      990

      Block Input Operations            0

      Block Output Operations           0

Reeza
Super User

proc means data=sashelp.class nway noprint;

class sex age;

output out=final n= /autoname;

run;

Works for me as well. If you just want a count though, could use proc freq.

proc freq data=final_row noprint;

tables mco*agegroup*gender*RiskGroup/out=final;

run;

SASPhile
Quartz | Level 8

Thanks.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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
  • 3 replies
  • 1200 views
  • 1 like
  • 3 in conversation