As a general rule where you are dealing with large datasets (> 1GB) and there are many distinct values of the class variables, I have often found SAS will process faster using BY rather than CLASS even with the SORT time added in as well. If your data is already sorted in the right order then the benefit is even greater.
... View more