> Note that I cannot do a simple Proc Summary, as some
> variables need to be summed and some need to be
> maximized. Thank you in advance.
note that all you were seeking can be achieved in proc summary. You may not have noticed that most of its documentation is provided under the procedure name "proc means".
proc means data= sashelp.class ; * names the data to analyse ;
class sex ; * grouping variable ;
var age height weight ; * variables for statistics ;
output out= stats /* names your output table */
min( age) = youngest
max( age)= oldest
sum( weight)= total_weight
max(height)= tallest ;
provides a table with 3 rows:
first an overall summary,
then a row for each value of the class variables
The results table has columns
one column for each class variable (just sex in this example)
a column (_type_) which indicates the aggregating level
a column (_freq_) indicating the number of input rows contributing
and a column for each statistic requested.
so just wanted to clarify that, although you may achieve the summarising you need in proc SQL, you might find PROC MEANS more helpful.