I have some duplicated stays in my dataset that i need to extract the last number of this. In the same data I also have some id that have overlap dates, that i only need to take out the longest stay in hospital. In addition, I have also some stay in hospitals that one stay follow the other one. That i asked you what should I do?
Se the following dataset that i have under here:
I want that i extract last observation for P00009779 that is sekv =5, max daydiff for P0000066881 that is daydiff =19 and sum all stays for P000209192 that is complicated for me. Is there a nice tip to do this for each problem and merge data after?
Please post what you want the desired result to look like. Makes it much easier to provide a usable code answer.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.