The OUTPUT statement creates the SUMSTAT data set and outputs the mean value for the final grade to the new variable AverageGrade. IDGROUP outputs the name of the student with the top exam score to the variable BestScore and the observation number that contained the top score. WAYS and LEVELS output information on how the class variables are combined.
   output out=sumstat mean=AverageGrade
          idgroup (max(score) obs out (name)=BestScore)
          /ways levels;