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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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