PROC MEANS DATA=&dsn. NOPRINT; BY &by_vars.; VAR prn; OUTPUT OUT=T0(KEEP=&by_vars.) N=DUMMY; RUN; proc print data=T0;run; PROC FREQ DATA=&dsn. NOPRINT; TABLES stratum /MISSING LIST OUT=T1(RENAME=(COUNT=PSUM0) KEEP=COUNT stratum) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES grp_geo /MISSING LIST OUT=T2(RENAME=(COUNT=PSUM1) grp_geo) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES geosmpl /MISSING LIST OUT=T3(RENAME=(COUNT=PSUM2) KEEP=COUNT geosmpl) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES ebsmpl /MISSING LIST KEEP=COUNT ebsmpl) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES group /MISSING LIST group) NOPERCENT NOCUM NOPRINT; RUN; *** the tables together. ***; PROC SORT DATA=T0; BY stratum; RUN; DATA T0; T0 T1; BY stratum; RUN; PROC SORT DATA=T0; BY grp_geo; RUN; DATA T0; MERGE T0 T2; BY grp_geo; RUN; PROC SORT DATA=T0; BY geosmpl; RUN; DATA T0;
PROC MEANS DATA=&dsn. NOPRINT; BY &by_vars.; VAR prn; OUTPUT OUT=T0(KEEP=&by_vars.) N=DUMMY; RUN; proc print data=T0;run; PROC FREQ DATA=&dsn. NOPRINT; TABLES stratum /MISSING LIST OUT=T1(RENAME=(COUNT=PSUM0) KEEP=COUNT stratum) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES grp_geo /MISSING LIST OUT=T2(RENAME=(COUNT=PSUM1) grp_geo) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES geosmpl /MISSING LIST OUT=T3(RENAME=(COUNT=PSUM2) KEEP=COUNT geosmpl) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES ebsmpl /MISSING LIST KEEP=COUNT ebsmpl) NOPERCENT NOCUM NOPRINT; RUN; PROC FREQ DATA=&dsn. NOPRINT; TABLES group /MISSING LIST group) NOPERCENT NOCUM NOPRINT; RUN; *** the tables together. ***; PROC SORT DATA=T0; BY stratum; RUN; DATA T0; T0 T1; BY stratum; RUN; PROC SORT DATA=T0; BY grp_geo; RUN; DATA T0; MERGE T0 T2; BY grp_geo; RUN; PROC SORT DATA=T0; BY geosmpl; RUN; DATA T0;
2010AdultSamplingReport.docx