x cd /pub/data/popests/Tools; %let pgm=ctychar_cnvt20yy; filename pgm "&pgm..sas"; *--Convert ctychar county characteristics review file data from Bureau/FSCPE (via RB) These are mars type data by Mo county by single years of age, sex, race (alone only + MR) and hispanic. Data is not to be made directly available to public. John Blodgett, OSEDA, U of Mo Outreach & Extension Under contract with the Missouri Census Data Center 10/04 --*; /* Update History Oct. 11, 2004: Begin work. */ %let year=2003; %let yr=%substr(&year,3,2); libname popests "/pub/data/popests"; libname georef '/pub/data/georef' access=readonly; title "&pgm : Process Special MARS File With Data by Single Years of Age"; x cd /pub/data/popests; *<====; %let state=29; %let stab=mo; *<---in cased we ever want to modify for some other state--; %let set=&stab.ctychar&yr; filename in pipe "unzip -p ctychar2003_&state"; data &set(label="Pop Ests by County, Age (Single Years), Sex, Race, Hispanic: 2000 - &year" compress=no); infile in dsd missover firstobs=2 ; *** obs=4000; length County $5 Year $4 Month $1 Age 3 Sex $1 Race1 $1 Hispanic $1 Estimate 5; keep County -- Estimate; input _st _co Year Month Age Sex Race1 Hispanic Estimate; label age='Age in Years' Race1='Cen2k Race Alone and Multiple Race'; retain county; if _co ne lag(_co) then do; County=put(_st,z2.)||put(_co,z3.); end; if Estimate gt 0; *<-----No need to keep all the 0 cells------; run ; proc sort out=popests.&set(label="&stab county chars file (single years of age estimates) 2000-&year") ; by county age sex race1 hispanic year month; run; *---Do a test report showing persons age 0-17 and 18-24 by hispanic and by race---; data totab; set popests.&set; where 15 <= age <= 19; Time='Jul '||year; if month='4' then Time='Apr 2000'; drop year month ; run; proc format; value age 15-17='15 to 17' 18-19='18 to 19'; value $race 1='White' 2='Black' other='Multi-race or other race alone'; value $hispanic 1='Non-Hispanic' 2='Hispanic'; run; proc tabulate data=totab format=comma9.; var estimate; class time county race1 hispanic age; label race1='Race (Alone)'; format county $mocnty. race1 $race. hispanic $hispanic. age age.; table time, (all='Missouri' county) * (all='All races' race1), (all='Total' hispanic=' ')*(age all='15-19')*Estimate=' '*sum=' ' ; title2 'Tables of Persons Aged 15-19 by Under/Over 18 by Race/Hispanic and Age'; footnote .h=1 'Source: Unpublished County Characteristics Files from Census Bureau / FSCPE'; run;