Hello, I am still pretty basic with SAS programming but my supervisor assigned me an uneasy project that I have been stuck with for a while. I have a primary dataset, each row constitute a spinal surgical hospitalization with variables like patient's age, gender, diagnoses..etc. A patient may have different rows (hospitalizations) in the same dataset. My project aim is to track readmissions in spinal surgical patients within 90 days of the procedure. I want to create a 0/1 variable for the first hospitalization of every spinal surgical patient with a value of 1 if the patient had ANY number of readmissions within 90 days. To link patients there a 3 variables to be used: Key: A unique number for every hospitalization ( every row has a unique key) VisitLink: A value that is the same for the same patient across different hospitalizations DaysToEvent: unique value that if you subtract it from the DaysToEvent value of different hospitalization it yields how many days there were between hospitalization. I would really appreciate any help regarding how to create a final dataset with the first hospitalization for every patient and a variable that indicates if he got readmitted within 90 days or not.
... View more