Hello, I am using SAS 9.4 I am currently trying to figure out how to move data from the columns of rows with the same ID and trying to move it all into the same row. There are two specific column datas that I want to move around, cname and cdate.
I have a large set of data and there are a lot of different ID's in there with different amount of rows. Here's a sample snippet
Set: Have
ID cname cdate
A org1 12/21/2018
A org2 1/1/2018
A org1 3/31/2018
A org3 6/12/2018
A org3 11/11/2018
A org2 12/3/2018
B org4 1/4/2018
C org4 4/27/2019
C org1 1/6/2019
C org3 2/2/2019
SET: Want
ID cname1, cname 2, cname 3, cname4 cdate1 cdate2 cdate3 cdate4 cdate5 cdate6
A org 1 org2 org3 -- 12/21/18 1/1/18 3/31/18 6/12/18 11/11/18 12/3/18
B -- -- -- org4 1/4/18 -- -- -- -- --
C org1 -- org3 org4 4/27/19 1/6/19 2/2/19 -- -- --
In the end what I want is just one row per patient with extra columns stating all the extra cnames and cdates that they have. Each ID varies and may have 1-20 cdates and 1-10 unique cnames. Is this even possible or would I just have to manually do this?
Thanks
... View more