With proc means or summary the data need not be sorted first if using a CLASS statement to group your data.
proc summary data = data=auto21 nway; /* NWAY says to only output the full combinations when using class variables, don't use if you want to examine all of the combinations of class variables*/
/* where is also a valid statement in some procs*/
where COMPANY_STATUS='ACTIVE' AND COMPANY_CLASS='Public';
/* grouping variables*/
class COMPANY_STATUS;
/* analysis variables*/
var _PAIDUP_CAPITAL_;
output out= act12(drop=_type_ _freq_) max=;
run;
_type_ is a special variable that describes which combination of class variables the output record belongs to, _freq_ is how many records were examined to get the statistics.
... View more