Proc Means produce statistics for subgroup only if it is sorted first. At the same time, Proc Summary can produce statistics for all groups automatically.