Proc Summary/Means by default will include summaries for all combinations of all the class varaibles, including all records. If you examine your output data set there is a variable named _type_ that has values of 0 and 1. The 0 is the overall summary. If you have two Class variables you will have _type_ = 0,1,2 and 3. 0 would be the overall summary, 1 the summary of only one of the class varaibles, 2 the other class variable and 3 would be the combinations of the class variables.
The NWAY option on the procedure statement says to only include the combinations of all the variables and not the overall, in effect selecting only the largest value of the _type_ variable. There are also statments like WAYS and TYPES that offer other methods of controlling which subsets of the combinations of class variables appear in the output. Completetypes option on the Proc statement will make sure that all combinations of the values of the class variables, even those that do occur in the data, are present in the summary.
This can be a very helpful feature as you can get multiple summaries with one pass through the data and select the desired data by filtering on the _type_ variable.
... View more