Wow, I had a longer response, but I timed out because I was busy testing everyone's code suggestions with my actual data. That's a good point about not using Tabulate. In truth, I used it because at the time I only had to copy, paste and tweak some of my existing code from another SAS program. I admit I was being lazy, but isn't that one of the traits of being a programmer? I'm looking now at putting this into a more production environment, so that's why optimizing is important. For me (or at least in the environment I work in), part of optimization takes into account code maintenance. Not only is your solution speedy with my data set, it's also easy on the eyes for good code maintenance. Thank you!
... View more