x cd /pub/data/popests/Tools; %let pgm=casrh_genrepts06; filename pgm "&pgm..sas"; /*-------Generate tables summarizing data in the casrh datasets. John Blodgett, OSEDA, Under contract with the Missouri Census Data Center Running for all states, 8-9-07----- And again after fix to data, 9-10-07 (Each time the run encountered a resources error near the end of processing the 2nd set of reports around Texas and had to run it a 2nd time to complete that phase.) ------*/ libname popests "/pub/data/popests"; %let year=2006; %let yr=%substr(&year,3,2); %include 'casrh_formats.sas'/nosource2; %let webdir=%str(/pub/reports/casrh06); 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, 2000 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='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.&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 8-9-2007."; 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(n=51,names=1,msgs=1,mac=dorepts); *<======================================NOTE======; %macro dorepts2(state,stab); ods pdf file="&webdir/&stab.r2county.pdf" style=sasweb NOTOC; title "Population Estimates for &statenm, April 1, 2000 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='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.&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='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.&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; %dostates(n=51,names=1,msgs=1,mac=dorepts2); *<============================NOTE====================; *--Got an "Out of memory" error while processing Utah on first try-----------------; %*ostates(48 49 50 51 53 54 55 56 ,names=1,msgs=1,mac=dorepts2); %***dostates(04,names=1,msgs=1,mac=dorepts2);