Hi all. As a new employee I inherited the following code, but for some reason it runs without errors but the only exclusion that works is the first one (Excluding age <18). The rest do not make the exclusions but the code still runs. Any suggestions would be greatly appreciated. /** Excluding age <18 */
data data_1a;
set inpt_hosp_1;
if age <18 then delete;
run;
/**Exclude index admissions for patients who died during the admission (Patient
Discharge Status Code indicating �Expired� (20)):*/
data data_1b;
set data_1a;
if disch_stat_cd='20' then delete;
run;
/**Exclude index admissions for patients discharged Against Medical Advice (AMA)
(Patient Discharge Status Code indicating �Left Against Medical Advice� (07)):**/
data data_1c;
set data_1b;
if disch_stat_cd='7' then delete;
run;
/**Exclude index admissions for patients transferred to another acute care hospital during
the index admission (Patient Discharge Status Code indicating transfer to an acute care
facility (02, 05, 09, 30, 43, 66, 69)):**/
data data_1d;
set data_1c;
if disch_stat_cd in ('02', '05', '09', '30', '43', '66', '69') then delete;
run;
/** Exclude index admissions for patients discharged with a planned readmission (Patient
Discharge Status Code indicating discharge with a planned readmission (81-95)):**/
data data_1e;
set data_1d;
if disch_stat_cd in ('81','82','83','84','85','86','87','88','89','90','91','92','93','94','95') then delete;
run;
... View more