BookmarkSubscribeRSS Feed
Dhana18
Obsidian | Level 7

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:

IDThroatPainDysuriaGenitalDischargeRectalPainAbdominalPainTreatmentTreatmentRxTreatmentRxOtherTreatmentRx2TOCSexAtBirth
773233NoYesYesUnknownNo7/6/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
783394NoNoNoUnknownNo8/17/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
785878NoNoNoUnknownYes8/1/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gm Female
976906NoNoYesUnknownNo11/27/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
976916NoNoNoUnknownNo11/29/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gm Female
979830NoNoYesUnknownNo11/29/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gm Female
005182NoYesYesUnknownNo12/12/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
005185NoNoYesUnknownNo12/12/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
010768NoNoNoUnknownNo12/19/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gmYesMale
013588NoYesYesUnknownNo12/15/2017Ceftriaxone (Rocephin) 250 mg Azithromycin (Zithromax) 1 gm Male
1 REPLY 1
mkeintz
PROC Star

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

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

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

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 646 views
  • 0 likes
  • 2 in conversation