I have a SAS dataset that has multiple listings per person and variables (Treat_Date1, Treat_Date2, Treat_Date3) whenever they are treated. I need to take this and create a dataset with one observation per person with all of their treatment dates.
When a treatment is given it idealy would be listed as Treat_Date1 the first time and would carry to their other observations but that’s unfortunately not the case. A person could have several unique Treat_Date1’s and no Treat_Date2’s.
Three examples
I have tried to create new variables each holding a listing, using retain and then outputing at the last per person. However I don’t know how many treatments a person could have and end up missing dates.
Also I am new to SAS and bit unfamilar with some syntax. Thank you all for your help.
Andrew Caddell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.