Nway sas proc summary where

Here is the example:

data a;

set sashelp.class;

if age =11then age =.;

run;

procsortdata = a out = class1;

by sex age;

run;

data class2;

set a;

run;

procmeansdata = class1 nwaynoprint;

by sex age;

var height;

outputout = two1 mean =;

run;

procmeansdata = class2 nwaynoprintmissing;

class sex age;

var height;

outputout = two2 mean =;

run;

procprintdata = two2;run;

Obs Sex Age _TYPE_ _FREQ_ Height

1 F. 3 1 51.3000

2 F 12 3 2 58.0500

3 F 13 3 2 60.9000

4 F 14 3 2 63.5500

5 F 15 3 2 64.5000

6 M. 3 1 57.5000

7 M 12 3 3 60.3667

8 M 13 3 1 62.5000

9 M 14 3 2 66.2500

10 M 15 3 2 66.7500

11 M 16 3 1 72.0000

Linlin