x cd /pub/data/sf12000/Tools; %let pgm=agg_males1825_mocnty; filename pgm "&pgm..sas"; *--access the special sf1.agersexh table (derived from the p12 tables) to get counts of males aged 18-25 by Missouri county--; libname sf1 '/pub/data/sf12000'; *---Per request from Debbie Pitts, aggregate to get males age 18-25 by county---; proc sql; create table males1825 as select county, sum(persons) as Males18_25 from sf1.moagersexh where race=' ' and hispanic=' ' and age between 18 and 25 and sex='m' group by county; data report; set males1825; fips=county; format county $mocnty.; format Males18_25 comma9.; run; proc print data=report; title 'Males 18-25 by Missouri Counties'; id county; sum _numeric_; run; filename dlmout "&pgm..csv"; %cnvtdlm(setin=report,names=1) run;