I have two data sets, one with Admission Dates and the other with discharge dates. When I merge the two together it merges all the admission dates first like AdmitDate1, AdmitDate2, etc...and then has the DischargeDate1, DischargeDate2, I was wondering in my output how I can alternate the admitDate1, DischargeDate1, admitDate2, DischargeDate2....instead of all the admission dates first, and then the discharge dates second. here is my code: proc transpose data=Discharges.Detail out=Discharges.Detail1 prefix=Admission_Date; by PatientID; var Admission_Date; run; proc transpose data=Discharges.Detail out=Discharges.Detail2 prefix=Discharge_Date; by PatientID; var Discharge_Date; run; data Discharges.DetailFinal; merge Discharges.Detail1 Discharges.Detail2; by PatientID; run; proc export data=Discharges.DetailFinal outfile="'&Output\DischargeDetailFinalized'" dbms = xlsx replace; run; Thank you in advance...
... View more