DATA Step, Macro, Functions and more

Output dataset

Reply
Super Contributor
Posts: 673

Output dataset

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

Regular Contributor
Posts: 233

Output dataset

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

Super User
Posts: 19,815

Output dataset

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;

Super Contributor
Posts: 673

Output dataset

Thanks.

Ask a Question
Discussion stats
  • 3 replies
  • 222 views
  • 1 like
  • 3 in conversation