BookmarkSubscribeRSS Feed
user40
Calcite | Level 5

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 haveData 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?

 

 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Please post what you want the desired result to look like. Makes it much easier to provide a usable code answer.

user40
Calcite | Level 5
I cannot add code since the code on a server

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 229 views
  • 0 likes
  • 2 in conversation