When you specify only
one variable in the ID statement, the value of the ID variable for
a given observation is the maximum (minimum) value found in the corresponding
group of observations in the input data set. When you specify multiple
variables in the ID statement, PROC MEANS selects the maximum value
by processing the variables in the ID statement in the order in which
you list them. PROC MEANS determines which observation to use from
all the ID variables by comparing the values of the first ID variable.
If more than one observation contains the same maximum (minimum)
ID value, then PROC MEANS uses the second and subsequent ID variable
values as “tiebreakers.” In any case, all ID values
are taken from the same observation for any given BY group or classification
level within a type.