x cd /pub/data/popests/Tools; %let pgm=nchsbri_ksmetro_hispanic; filename pgm "&pgm..sas"; *--Do some custom tabs re data for hispanics and non hispanics by age for 1990, 2000 and 2009. Done per request from C.V. Case at Aloanzas. 2-11. --*; libname nchs '/pub/data/popests/nchsbri' access=readonly; title "Hispanic Population Trends by Selected Age Cohorts: 1990, 2000 and 2009"; footnote h=1 "Generated from &pgm..sas in popests/Tools by J.Blodgett, Feb. 2011"; data ks90; set nchs.ksnchsbridged19xx(keep= county age hispanic popjl90); where county in ('20091','20209'); *---Johnson and Wyandotte cos, KS--; year='1990'; pop=popjl90; drop popjl90; data ks20; set nchs.ksnchsbridged20xx(keep= county age hispanic popjl00 popjl09); where county in ('20091','20209'); *---Johnson and Wyandotte cos, KS--; year='2000'; pop=popjl00; output; year='2009'; pop=popjl09; output; drop popjl00 popjl09; run; data mo90; set nchs.monchsbridged19xx(keep= county age hispanic popjl90); where county in ('29037', '29047','29095','29165','29177'); *---Cass, Clay, Jackson, Platte and Ray, MO--; year='1990'; pop=popjl90; drop popjl90; data mo20; set nchs.monchsbridged20xx(keep= county age hispanic popjl00 popjl09); where county in ('29037', '29047','29095','29165','29177'); *---Cass, Clay, Jackson, Platte and Ray, MO--; year='2000'; pop=popjl00; output; year='2009'; pop=popjl09; output; drop popjl00 popjl09; run; proc format; value $ageco '00'-'04'=' 0 to 4' '05'-'13'=' 5 to 13' '14'-'17'='14 to 17' '18'-'24'='18 to 24' '25'-'99'='25 and over'; value $hispanic '1'='Non-hispanic' '2'='Hispanic'; run; data all; set ks90 ks20 mo90 mo20; run; ods html file="&pgm..html"; proc tabulate data=all; class year hispanic age county; format hispanic $hispanic. age $ageco. county $county.; var pop; table (all='KC Metro Totals' county)*year*hispanic, (age all="Total")*pop="Persons"*sum=' '*f=comma11. ; run; ods html close;