x cd /pub/data/popests/Tools; %let pgm=casrh_genrepts15; filename pgm "&pgm..sas"; /*-------Generate tables summarizing data in the casrh datasets. John Blodgett, OSEDA, Under contract with the Missouri Census Data Center Preliminary edit 6/22/2015 10:14:05 AM ... Running for all states (??), 6-xx-15---- ------*/ libname popests "/pub/data/popests"; **proc reports group=memory; run; %let year=2015; %let yr=%substr(&year,3,2); %include 'casrh_formats.sas'/nosource2; %let webdir=%str(/pub/reports/casrh&yr); *<======Need to use mkdir to create this directory!!!!===========; 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; options pagesize=65; options nodate; %macro dorepts(state,stab); %local __i; title "Population Estimates for &statenm, April 1, 2010 and July 1, &year"; title2 'By Major Race (alone) Categories and Hispanic by Sex'; %do __i=1 %to 2; %*---2 reports, 1 by state and county, the other by cbsa--; %if &__i=1 %then %do; %let geos=county; %let rname=&stab.r1county; %let title3=State and County Summaries; %end; %else %do; %let geos=cbsa; %let rname=&stab.r1cbsa; %let title3=State and CBSA Summaries; %end; title3 "&title3"; ods pdf file="&webdir/&rname..pdf" style=sasweb; *<====; proc tabulate data= popests.&stab.casrh&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='2010')*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.&stab.casrh&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"; title10 "Data Used in this Report Are Derived from Census Bureau Files Published Circa 6-25-&year."; *<=======!!!!!!=========; ***title11 "These Estimates Have Not Been Adjusted to Reflect Any Successful Challenges Regarding the County's Total Pop"; put /// @35 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; run; ods pdf close; %end; %mend dorepts; %dostates(29,names=1,mac=dorepts); %dostates(01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28, msgs=1,names=1,mac=dorepts) %dostates(30 31 32 33 34 35 36 37 38 39 40 41, msgs=1,names=1,mac=dorepts) %dostates(42 44 45 46 47 48 49 50 51 53 54 55 56, msgs=1,names=1,mac=dorepts) ; %macro dorepts2(state,stab,pdf); %if &pdf = %str() %then %let pdf=pdf; %if &pdf =pdf %then %let notoc=NOTOC; %else %let notoc=; ods &pdf file="&webdir/&stab.r2county.&pdf" style=sasweb &NOTOC; title "Population Estimates for &statenm, April 1, 2010 and July 1, &year"; title2 'Total and 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='2010')*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.&stab.casrh&yr - access via uexplore/dexter"; title8 "See https://mcdc.missouri.edu/pub/data/popests/Datasets.html"; put /// @25 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; 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='2010')*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.&stab.casrh&yr - access via uexplore/dexter"; title8 "See https://mcdc.missouri.edu/pub/data/popests/Datasets.html"; put /// @35 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; run; ods &pdf close; %mend dorepts2; %***dorepts2(29,mo,html); %*** ods html close; proc options; run; %dostates(29, msgs=1,names=1,mac=dorepts2) ; %dostates(01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28, msgs=1,names=1,mac=dorepts2) %dostates(30 31 32 33 34 35 36 37 38 39 40 41, msgs=1,names=1,mac=dorepts2) %dostates(42 44 45 46 47 48,mac=dorepts2) %dostates(49 50 51 53 54 55 56, msgs=1,names=1,mac=dorepts2); options mprint; %let statenm=Texas; %***dorepts2(48,tx,pdf) ; *---Here we incorportate the code which prior to 2013 was run from a separate job (e.g. casrh_genrepts11us.sas).----*; title "Population Estimates for the US and all States, April 1, 2010 and July 1, &year"; title2 'By Major Race (alone) Categories and Hispanic by Sex'; %let geos=state; ods pdf file="&webdir/usstatesr1.pdf" style=sasweb; *<====; proc tabulate data= popests.usstatescasrh&yr missing; class sumtype age race sex hispanic state; where sumtype='asrh'; format state $state.; format Sumtype $sumtype. age $age_. race $race. sex $sex. hispanic $hispani. ; var Popest_&year EstBase; table all='U.S. Totals' state, (all='All Ages' age)*(all='All Races' race hispanic), (all='Total' sex)*(popest_&year="&year" EstBase='2010')*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.usstatescasrh&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/usstatesr1.pdf"; title10 "Data Used in this Report Are Derived from Census Bureau Files Published Circa May, &year."; *<========; put /// @35 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; run; ods pdf close; title "Population Estimates for the US and all States, April 1, 2010 and July 1, &year"; title2 'Total and One-Dimensional Demographic Summaries (Hispanic, Race, Age and Sex)'; %let geos=state; ods pdf file="&webdir/usstatesr2.pdf" style=sasweb; *<====; proc tabulate data= popests.usstatescasrh&yr missing; format state $state.; class age race sex hispanic state; where sumtype='asrh'; format age $age. race $race. sex $sex. hispanic $hispani. ; var Popest_&year EstBase; table (all='Total Population' hispanic race age sex), (all='U.S. Totals' state)*(popest_&year="&year" EstBase='2010')*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.usstatescasrh&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/usstatesr2.pdf"; title10 "Data Used in this Report Are Derived from Census Bureau Files Published Circa June, &year."; *<========; put /// @35 "Missouri Census Data Center: https://mcdc.missouri.edu"; stop; run; ods pdf close;