x cd /pub/data/popests/Tools; %let pgm=casrh_genrepts; filename pgm "&pgm..sas"; /* ============It appears that this setup has been superceded by the individual casrh_genreptsXX.sas modules as of 2014 at least */ /*-------Generate tables summarizing data in the casrh datasets. John Blodgett, OSEDA, Under contract with the Missouri Census Data Center ------*/ libname popests '/pub/data/popests'; proc options group=memory; run; %let year=2013; %let yr=%substr(&year,3,2); %include 'casrh_formats.sas'/nosource2; %let webdir=%str(/pub/reports/casrh13); ods listing close; proc format; *<--override default age categories--; value $age_ ' '='Total' '01'-'04'=' 0 to 19' '05'-'09'='20 to 44' '10'-'13'='45 to 64' '14'-'18'='65 +'; ***value $race_ '03'-'05'='Other single race' other=[$race.]; value $cbsa_ ' '='(Outside any metro and micropolitan areas)' other=[$cbsa.]; run; title "Population Estimates for Missouri, April 1, 2000 and July 1, &year"; options nodate; %macro dorept(rname,title3,geos,toc=0); title2 'By Major Race (alone) Categories and Hispanic by Sex'; title3 "&title3"; %local notoc; %if &toc=0 %then %let notoc=NOTOC ; ods pdf file="&webdir/&rname..pdf" style=sasweb ¬oc; *<====; proc tabulate data= popests.mocasrh&yr missing; class sumtype age race sex hispanic county cbsa; where sumtype='asrh'; format Sumtype $sumtype. age $age_. race $race. sex $sex. hispanic $hispani. ; format cbsa $cbsa_.; *<====see https://mcdc.missouri.edu/sas/formats/Scbsa.sas ; var Popest_&year EstBase; table all='State Totals' &geos, (all='All Ages' age)*(all='All Races' race hispanic), (all='Total' sex)*(popest_&year="&year" EstBase='2000')*sum=' '*f=comma11.; run; data _null_; file print ; title5 "Generated by Setup in /pub/data/popests/Tools/&pgm..sas"; title7 "Data used in this report is in popests.mocasrh&yr - access via uexplore/dexter"; title8 "See https://mcdc.missouri.edu/pub/data/popests/Datasets.html"; title9 "URL for this report: https://mcdc.missouri.edu/&webdir/&rname..pdf"; put /// @35 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; run; ods pdf close; %mend dorept; /*<=========================Comment out===================================== %dorept(mor1county,State and County Summaries,county,toc=1); %dorept(mor1cbsa,State and CBSA Summaries,cbsa,toc=1) ===========================End commented out================================ */ %macro dorept2(stab); %if &stab=mo %then %let statenm=Missouri; %else %if &stab=il %then %let statenm=Illinois; %else %if &stab=ks %then %let statenm=Kansas; ods pdf file="&webdir/&stab.2county.pdf" style=sasweb NOTOC; title "Population Estimates for &statenm, April 1, 2000 and July 1, &year"; title2 'One Dimensional Demographic Summaries (Hispanic, Race, Age and Sex)'; proc tabulate data= popests.&stab.casrh&yr missing; title3 'By County'; class age race sex hispanic county cbsa; where sumtype='asrh'; format age $age. race $race. sex $sex. hispanic $hispani. ; format cbsa $cbsa_.; *<====see https://mcdc.missouri.edu/sas/formats/Scbsa.sas ; format county $county.; var Popest_&year EstBase; table (all='Total Population' hispanic race age sex), (all='State Totals' county)*(popest_&year="&year" EstBase='2000')*sum=' '*f=comma11.; run; ods pdf close; ods pdf file="&webdir/&stab.r2cbsa.pdf" style=sasweb NOTOC; proc tabulate data= popests.&stab.casrh&yr missing; title3 'By Metropolitan and Micropolitan Statistical Areas (CBSA''s))'; title4 "&statenm Portions Only"; class age race sex hispanic county cbsa; label cbsa='CBSA: Core Based Statistical Area'; where sumtype='asrh'; format age $age. race $race. sex $sex. hispanic $hispani. ; format cbsa $cbsa_.; *<====see https://mcdc.missouri.edu/sas/formats/Scbsa.sas ; format county $county.; var Popest_&year EstBase; table (all='Total Population' hispanic race age sex), cbsa*(popest_&year="&year" EstBase='2000')*sum=' '*f=comma11.; run; ods pdf close; %mend dorept2; %dorept2(mo); %dorept2(il); %dorept2(ks);