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