x cd /pub/data/dhc2020x/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/* Invoke the %doset macro to create observations in the Datasets dataset for this directory. */
title "Job to invoke doset macro for sets in dhc2020x, creating dhc2020x.datasets";
options notes nosource nosource2 nosymbolgen nomprint;
%include '/pub/sas/autoexec.sas';
libname dhc2020x '/pub/data/dhc2020x';
%let libnameg = dhc2020x;
%let todo=;
%let todolist=;
/* Run this step ONLY ONCE. If you need to rerun (start over),
delete the datasets dataset first. doset will not allow initialize
mode if the datasets set already exists. */
%doset(mode=initialize, libname=dhc2020x, debug=1);
%macro doit(state,stab);
%doset(
mode=,
libname=dhc2020x,
memname=&stab.blocks,
geouniv=&statenm,
units=%str(census block),
Years=2020,
CreatePgm=cnvt_dhc2020x,
Keywords=2020 census standard extract blocks,
Description=%nrbquote(Standard extract tables for &statenm census blocks),
keyvars=county placefp cousubfp cbsa metrodiv,
keyfmats=county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| state county ),
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=county tract block,
UsageNotes=%nrbquote(
- This is a standard extract of the data set with the same name in the dhc2020 data directory. That data set comprises detailed tables as defined and released by the Census Bureau. The data in this set are derived from those tables.
- There are some variables available in other data sets in this collection that are undefined at the block level. These are variables that require PCT table data which is not available at the block level.
- The 2010 population figure was approximated using the equivalencies provided in the blkrel20 data collection from the Census Bureau.
- See the Variables.pdf file for variable details.
),
SubType=block,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=&stab.bgs150,
geouniv=&statenm,
units=%str(block groups),
Years=2020,
CreatePgm=cnvt_dhc2020x,
Keywords=2020 census standard extract complete block groups,
Description=%nrbquote(Standard extract tables for &statenm block groups),
keyvars=county cbsa metrodiv,
keyfmats=county cbsa metrodiv,
keyquals=%str(| | | ),
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=county tract bg,
UsageNotes=%nrbquote(
- This is a standard extract of the data set with the same name in the dhc2020 data directory. That data set comprises detailed tables as defined and released by the Census Bureau. The data in this set are derived from those tables.
- There are some variables available in other data sets in this collection that are undefined at the block level. These are variables that require PCT table data which is not available at the block level.
- The 2010 population figure was approximated using the equivalencies provided in the blkrel20 data collection from the Census Bureau.
- See the Variables.pdf file for variable details.
),
SubType=bg,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=&stab.selectedinv,
geouniv=&statenm,
units=%str(state county countysub place tract zcta),
Years=2020,
CreatePgm=cnvt_dhc2020x,
Keywords=2020 census standard extract inventory summary levels,
Description=%nrbquote(Standard extracts for &statenm common inventory summary levels),
keyvars= sumlev geocomp state county placefp cousubfp cbsa metrodiv,
keyfmats=sumlev geocomp state county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=SumLev esriid,
UsageNotes=%nrbquote(
- This is one of several data sets created for &statenm. Summaries for the state, counties, places, ZCTAs, census tracts, etc.
- The 2010 population figure was taken from the SF1 extract data set from the 2010 census. If an area has changed definition over the decade, the 2010 population figure is for the old geographic definition. An exception is census tracts, which were aggregated up from block-level estimates using blkrel20 equivalency files.
- See the Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%mend doit;
/*
%dostates(01 15,names=1) ;
%dostates(06 10 20 42 56,names=1) ;
%dostates(02 08 09 31 37,names=1);
%dostates(04 27 30 36 40 50,names=1);
%dostates(13 21 23 33 72 51,names=1);
%dostates(16 29 39 49 54 55,names=1);
%dostates(17 18 32 41 46 53,names=1);
%dostates(05 22 19 34 48,names=1);
%dostates(11 12 25 26 45,names=1);
%dostates(28 35 38 44 47,names=1)
%dostates(24,names=1)
*/
%dostates(n=52,names=1) ;
/*<=========================Comment out=====================================
%*--Here we do the new set of 2012 vintage data sets ;
%macro doit(state,stab);
%doset(mode=,libname=dhc2020x,
memname=&stab.cdsldspumas2012,
geouniv=&statenm,
units=%str(cd113 slds2012 pumas2012),
Years=2010,
CreatePgm=cnvt_dhc2020x_uscdslds2012,
Keywords=2010 census standard extract 2012 puma slds 113th cd summary levels,
Description=%nrbquote(Standard extracts for &statenm 2012-vintage CDs (113th), SLDS, and PUMAs),
keyvars= sumlev state county,
keyfmats=sumlev state county,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=SumLev esriid,
UsageNotes=%nrbquote(- These data aggregated from SF1 block level data using mable14 data to assign 2012 geocodes.
So there is no apportioning: these data should be exact.
- See Variables.pdf file for variable details.
- The 2000 population figure was taken from the mable14 pop2k variable.
- Variables derived from PCT and HCT tables are not on this data set.
),
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
SubType=cdsldspumas2012,
SetGroup=&stab,
VarSet=variables,
debug=0);
%mend doit;
%dostates(n=51,names=1);
%let statenm=United States;
%doit(00,us)
*/
/* Now do the national sets -- there's only one of each, so we don't use %dostates. */
%doset(
mode=,
libname=dhc2020x,
memname=uscousubs,
memlabel=,
geouniv=United States,
units=%str(county subdivisions),
sortprio=3,
Years=2020,
CreatePgm=create_us_datafiles,
Description=%nrbquote(Standard extract for all US county subdivisions),
keyvars= state county,
keyfmats=state county,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=state county cousubfp,
UsageNotes=%nrbquote(
- These areas vary by state as to what they are called. Towns and townships, mostly, also known as MCDs or minor civil divisions.
- This data set was created by selecting (SumLev=060) and concatenating the 52 state-level inventory data sets.
- The 2010 population figure was taken from the 2010 SF1 national data set using the county subdivisions as they were defined then.
- See the Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=ustracts,
memlabel=,
geouniv=United States,
units=%str(census tracts),
Years=2020,
CreatePgm=create_us_datafiles,
Keywords=2020 census standard extract tracts,
Description=%nrbquote(Standard extract for all US census tracts),
keyvars= state county ,
keyfmats= state county ,
keyquals= ,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=state county tract,
UsageNotes=%nrbquote(
- This data set was created by selecting (SumLev=140) and concatenating the 52 state-level inventory data sets.
- This data set is used by the caps2020 web application as the source data for large circular areas (over 20 miles).
- See the Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=usstcnty,
geouniv=United States,
units=%str(state county),
Years=2020,
CreatePgm=create_us_datafiles,
Keywords=2020 census standard extract state county,
Description=%nrbquote(Standard extract for all US states and counties),
keyvars=sumlev state county ,
keyfmats=sumlev state county,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=state county cousubfp,
UsageNotes=%nrbquote(
- This data set was created by selecting state and county level summaries from the 52 state-level inventory data sets and concatenating them.
- Includes county equivalents such as parishes in LA and independent cities.
- See Variables.pdf file for variable details.
- The 2010 population figures were taken from the 2010 SF1 national data set using the state and county as defined at that time.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0);
%doset(
mode=,
libname=dhc2020x,
memname=uszctas,
memlabel=,
geouniv=United States,
units=%str(ZCTAs),
sortprio=3,
Years=2020,
CreatePgm=create_us_datafiles,
Description=%nrbquote(Standard extract for all ZIP Code/ZCTAs within states),
keyvars= state ,
keyfmats= state ,
UsageNotes=%nrbquote(
- ZCTAs closely resemble but are not identical to ZIP codes. See MCDC's ZIP/ZCTA reference.
- Not all ZIP Codes are ZCTAs, but all ZCTAs correspond to residential ZIP codes.
- This data set was created by selecting 871 ZCTA/state level summaries from the 52 state-level inventory data sets and concatenating them.
- See Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=usplaces,
memlabel=,
geouniv=United States,
units=%str(place),
sortprio=3,
Years=2020,
CreatePgm=create_us_datafiles,
Keywords=2020 census standard extract place city,
Description=%nrbquote(Standard extract for all US places (cities)),
keyvars=state,
keyfmats=state,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=state place,
UsageNotes=%nrbquote(
- This data set was created by selecting 160 complete-place-level summaries from the 52 state-level inventory data sets and concatenating them.
- Places do not necessarily nest within counties, so no county codes are provided on this set. There are 155 SumLev summaries on the 52 XXinventory data sets if you need that geographic detail.
- The 2010 population figures were taken from the 2010 SF1 national data set using places as they were defined then.
- See Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=uscdslds,
memlabel=,
geouniv=United States,
units=%str(116th Congressional Districts and 2018 State Legislative Districts),
sortprio=3,
Years=2020,
CreatePgm=create_us_datafiles,
Description=%nrbquote(Standard extract for all 116th Congressional Districts and 2018 State Legislative Districts),
keyvars=sumlev state,
keyfmats=sumlev state,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=state,
UsageNotes=%nrbquote(
- This data set was created by selecting 500, 610 & 620 level summaries from the 51 state level inventory data sets and concatenating them.
- See Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=usregdiv,
memlabel=,
geouniv=United States,
units=%str(US total region division),
sortprio=3,
Years=2020,
CreatePgm=create_us_datafiles,
Description=%nrbquote(Standard extract for US totals, census regions, and census divisions),
keyvars=sumlev,
keyfmats=sumlev,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=sumlev region division,
UsageNotes=%nrbquote(
- This data set was created by aggregating state-level data to regions and divisions.
- See Variables.pdf file for variable details.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
%doset(
mode=,
libname=dhc2020x,
memname=usschools,
geouniv=United States,
units=%str(school districts),
Years=2020,
CreatePgm=create_us_datafiles,
Keywords=2020 census standard extract national school districts,
Description=%nrbquote(Standard extract for all US school districts),
keyvars=sumlev state,
keyfmats=sumlev state,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC),
SortedBy=sumlev,
UsageNotes=%nrbquote(
- This data set was created by selecting 950, 960, and 970 level school district summaries from the 52 state-level inventory data sets and concatenating them.
- See Variables.pdf file for variable details.
- The 2010 population figure was taken from the 2010 SF1 national data set using the districts as they were defined then.
),
SubType=selectedinv,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0
);
/*
*----And 3 custom Mo datasets---;
%doset(mode=,libname=dhc2020x,
memname=mocdslds2012,
geouniv=Missouri,
units=%str(2012 House & Senate dists and 113th CDs),
Years=2010,
CreatePgm=cnvt_dhc2020x_mocdslds2012,
Keywords=2010 census standard extract state house senate districts,
Description=%nrbquote(Mo House and Senate Districts 2012, 113th (elected in 2012) CDs),
keyvars=sumlev county,
keyfmats=sumlev mocnty,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/Mo redistricting office),
SortedBy=,
UsageNotes=%nrbquote(- This data set was created by aggregating SF1 block level data for MO using
a block level equivalency file obtained from the Mo redistricting office via GRC.
- See Variables.pdf file for variable details.
- Because we created these tabs by aggregating block level data we did not have any PCT or HCT tables data available. As a result
some variables are not included on this data set. These include detailed Asian and Hispanic categories (Samoan, Mexican, etc) as well
as a number of items related to same sex and unmarried parter households.
- The 2000 population figure is not available for these units.
- In addition to complete-district summaries we also include county portion summaries (levels 510, 612 and 622). The County
variable will be blank for complete-district summaries (levels 500, 610 and 620).
),
SubType=specialtab,
SetGroup=mo,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0);
%doset(mode=,libname=dhc2020x,
memname=moregns,
geouniv=Missouri,
units=%str(Various county-based regions),
Years=2010,
CreatePgm=cnvt_dhc2020x_moregns,
Keywords=2010 census standard extract regions aaa ded modot rpc unmx,
Description=%nrbquote(Mo County-based regions: RPCs, MoDOT, DED, AAA and UM Ext Regeions),
keyvars=sumlev ,
keyfmats=sumlev ,
keyquals=,
DataSource=%str(U.S. Bureau of the Census/MCDC county equivalency data),
SortedBy=,
UsageNotes=%nrbquote(- Custom aggregated by MCDC from SF1 county level data.
- The mocogeos dataset in the /pub/data/georef directory is the source for linking counties to these regions.
- As far as we know the regions are current as of early 2012.
- See Variables.pdf file for variable details.
),
SubType=specialtab,
SetGroup=mo,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0);
%doset(mode=,libname=dhc2020x,
memname=molibdists13,
geouniv=Missouri,
units=%str(library districts),
Years=2010,
CreatePgm=molibdists13,
Keywords=2010 census standard extract Missouri library districts,
Description=%nrbquote(Standard extract aggregated from moblocks to 2013-vintage Library Districts),
keyvars=distcode,
keyfmats=libdname,
keyquals=,
DataSource=%str(U.S. Bureau of the Census, MCDC Custom processing.),
SortedBy=,
UsageNotes=%nrbquote(- There are portions of the state that are not within any library district.
- Some variables available at higher geographic levels are not available on this data set. It only has
variables which are defined at the block level.
- Uses the block-level equivalency file created by J. Harlan, GRC - stored in corrlst.mobl2libd2010,
),
SubType=,
SetGroup=mo,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/dhc2020x/Variables.pdf),
debug=0);
*/
/* post processing */
proc sort data=dhc2020x.datasets out=bysortprio; by sortprio; run;
proc print data=bysortprio;
by libname notsorted libpath ;
id memname;
var SortPrio SetGroup SubType VarSet URLmeta GeoUniv years ;
title2 'Listing of selected fields from dhc2020x.datasets (sorted by SortPrio)';
run ;
proc datasets library=dhc2020x nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options NOmprint msglevel=i;
%gendshtm(libname=dhc2020x,debug=0,runprocc=1);