So, @jitb , I would like to briefly summarize the responses so far. In order for you to have the best chance of getting good replies in the future, please keep these things in mind:
When you are having problems, we need a clear explanation of what you are trying to do. Do not assume that because you posted code that doesn't work, we know what you want.
We also need to know you think the correct answer is, or at least the correct thing for the code to be doing.
We need a portion of your SAS data set, or we need made up data as long as it illustrates the problem. Please follow these instructions and examples to provide the data.
If there are errors in the log, please show us the LOG (start to finish) for the DATA step or PROC that you are having errors in. Do not show us tiny portions of the log.
... View more