Please help me with the following code, I'm using SAS 9.3. I'm trying to create age categories for children: Birth up to 1 1-5 years old 6-12 years old 13 up to 18 data new; set old; if subject_age=0 or age_unit in ("Hours","Days","Months") then age_cat=1; if 1<=subject_age<=5 and age_unit in ("Years") then age_cat=2; if 6<=subject_age<=12 and age_unit in ("Years") then age_cat=3; if 13<=subject_age<=17 and age_unit in ("Years") then age_cat=4; run; Each time I run the code, all observations are coded as age_cat=1
... View more