Here are the notes: 1. The solution loops through the entire dataset twice processing one by group at a time 2. On the 1st pass, we calculate the max for each by group. I guess this is self explanatory 3. The call missing assigns a missing value to erase the max of the previous by group that is retained in memory. This helps in avoiding the mess while processing the next by group 4. Once we have completed the 1st pass, the 2nd pass basically filters the records using the max value that was obtained in the first pass and with your stated conditions 5. The explicit output statement overrides the implicit output as it is very important to control for the reason the processing of the dataset by groups using Dow loop happens in memory and implicit output by default happens only when sas processes the last observation of the by group. Hope this helps PS Do get book by Ron cody/ Art Carpenter without fail if you really want to speed up your learning
... View more