I have a data like this, attached. I would like to have a row per id that includes unduplicated info from other rows for all var in one row.
Desired table is something like this:
ID | ThroatPain | Dysuria | GenitalDischarge | RectalPain | AbdominalPain | Treatment | TreatmentRx | TreatmentRxOther | TreatmentRx2 | TOC | SexAtBirth |
773233 | No | Yes | Yes | Unknown | No | 7/6/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
783394 | No | No | No | Unknown | No | 8/17/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
785878 | No | No | No | Unknown | Yes | 8/1/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Female | ||
976906 | No | No | Yes | Unknown | No | 11/27/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
976916 | No | No | No | Unknown | No | 11/29/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Female | ||
979830 | No | No | Yes | Unknown | No | 11/29/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Female | ||
005182 | No | Yes | Yes | Unknown | No | 12/12/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
005185 | No | No | Yes | Unknown | No | 12/12/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
010768 | No | No | No | Unknown | No | 12/19/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Yes | Male | |
013588 | No | Yes | Yes | Unknown | No | 12/15/2017 | Ceftriaxone (Rocephin) 250 mg | Azithromycin (Zithromax) 1 gm | Male |
@Dhana18 wrote:
I have a data like this, attached. I would like to have a row per id that includes unduplicated info from other rows for all var in one row.
No data was attached. Could you please provide a sample of the initial data in the body of your request, in the form of a SAS data step? Help us help you.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.