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( ), 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( ), 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( ), 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(), 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( ), 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( ), 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( ), 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( ), 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( ), 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( ), 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( ), 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( ), 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(), 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(), 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(), 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);