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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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