LIBNAME in 'C:\Users\ldierker\Desktop\NSF2018data'; Data new; set WORK.DA36147P1; /*DS0001*/ proc sort; by hhx; /*proc contents; run; */ proc freq; tables region; Data new2; set WORK.DA36147P2; /*DS0002*/ proc sort; by hhx; proc freq; tables rectype fm_strcp fm_educ1 fslast fdmedyn fsbalanc fhicovyn incgrp2; proc contents; run; data tog1; merge new new2; by hhx; proc sort; by hhx fmx; Data new3; set WORK.DA36147P3; /*DS0003*/ proc sort; by hhx fmx; data tog2; merge tog1 new3; by hhx fmx; proc sort; by hhx fmx fpx; proc freq; tables rectype sex origin_I hispan_I mracrpi2 age_p r_maritl plborn regionbr geobrth yrsinus educ1 ernyr_p; Data new4; set WORK.DA36147P4; /*DS0004*/ proc sort; by hhx fmx fpx; data end; merge tog2 new4; by hhx fmx fpx; if sex ne .; if SHTHPV2 ne .; proc freq; tables fm_strcp fm_educ1 fslast fdmedyn fsbalanc fhicovyn incgrp2 region rectype sex origin_I hispan_I mracrpi2 age_p r_maritl plborn regionbr geobrth yrsinus educ1 ernyr_p shthpv2 shtflu2 sprflu2 apspap apsmam asisim asihivt asihivwn; data in.NHIS2013QUBES; set end; KEEP hhx fmx fpx fm_strcp fm_educ1 fslast fdmedyn fsbalanc fhicovyn incgrp2 region rectype sex origin_I hispan_I mracrpi2 age_p r_maritl plborn regionbr geobrth yrsinus educ1 ernyr_p shthpv2 shtflu2 sprflu2 apspap apsmam asisim asihivt asihivwn age; if age_p ge 18 and age_p le 21 then age=1; else if age_p ge 22 and age_p le 26 then age=2; else if age_p ge 27 and age_p le 35 then age=3; else if age_p ge 36 and age_p le 45 then age=4; else if age_p ge 46 then age=5; if shthpv2 ge 3 then shthpv2=.; proc sort; by hhx fmx fpx; proc freq; tables age_p; proc sort; by age; proc freq; tables shthpv2*sex /chisq; by age; RUN;