In line 28 in your log, you run the loop if n=1 then do;. In my code it is if _N_=1 then do;. There may be other errors as well, but it is bound to be that way if you change the code like this.
Please run my code exactly as it is written with the sample data 🙂
Before I explain: Did it work for you? And does it work for your actual data? 🙂
Thank you for marking my response as an accepted solution. However, can you please mark the response with the actual code as the solution?
Yes, I am aware that you have accepted this as a solution. However, it helps other users of the communities to browse the communities if you accept the reply that contains the actual code.
Also, you do not answer my question: Have you tried my code on your actual data?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.