If you provide an example dataset, in the form of a datastep, it will be much easier to see what you have and for someone to offer the best solution. As for inserting your program, copy it, paste it to notepad, re-copy it, and paste it here.
... View more