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.
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.