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: Data that i have
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.