x cd /pub/data/georef/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
********************************************************************************************************
* This setup was lost (in 2006) and has not been recovered. We now use fsedit to update the entries *
* for the CBSA related data sets each year. At least that is the plan. Doing it 10-22-08 for the *
* first time. Maybe later we can tackle this but it just does not seem quite worth it at this point. *
* THIS CAN BE RUN TO UPDATE THE AUTOMATIC PROC CONTENTS STUFF. <=======================NOTE!!! *
* jgb, 10.22.09 *
********************************************************************************************************
*----Ignore above comments. March, 2013 we are going to try and put back the cbsa-related defns after
an update to the defns.
------*/
libname georef '/pub/data/georef';
%let libnameg=georef;
option nofmterr;
%**let todolist=zcta_master;
%**let todolist=mocogeos14; *<====================================================================;
%*let todolist=puma_master;
%**et todolist=moblks_ur6;
%let todolist=adjacent_counties2010 adjacent_counties2010_collapsed;
%let todolist=cbsacos cbsacos15;
*-----Run this step ONLY ONCE------------------------------------------;
%*doset(mode=initialize,
libname=georef,memname=badblks,debug=1);
;
%macro dum;
data georef.datasets; set georef.datasets_old;
if memlabel=' ' and substr(memname,length(memname)-1,2)='04' then delete;
retain flag 0; drop flag; if memname='cbsapops04' then if flag=0 then do; flag=1; delete; end;
run;
data georef.datasets; set georef.datasets;
if setgroup='cbsaYY' then do;
**setgroup='cbsaYY';
CreatePgm='cbsas08'; Years='2008'; if memename='cbsapops' then Years='2000 2009'; *<===;
if memlabel ne ' ' then description=memlabel;
end;
run;
%mend dum;
/* ========================begin comment====================================
%doset(memname=zcta_master,memlabel=%str(ZIP/ZCTA master dataset vintage 2014),
geouniv=UnitedStates,Unit=ZCTA,Years=%str(2008-2012),
description=
%str(Comprehensive resource for these ZIP code proxies showing geographic correspondences and latest ACS-based demographics),
usageNotes=%nrbquote(
- A previous version of this dataset has been renamed zcta_master07 and is still available if you want to
work with vintage 2000 ZCTAs
- We replaced the version generated in Aug 2013 with this one in July 2014. We upated several geocodes and all the ACS data.
The ACS data are now 2008-2012 period estimates from the Census Bureau.
- Sumlev is 860, complete ZCTA. The ACS data are for entire ZCTA, but allocation factors and geos are within primary state. Only
103 ZCTAs cross state boundaries. To see them use Nstates=2 filter.
- The lat-long coordinate variables (IntPtLat and IntPtLon) are taken from the latest ACS data sets. Same with the SQMI vars.
- The naltzips and altzips fields allow you to identify special ("alternate") ZIP codes located within the ZCTA.
- We have a special Metatata file that you must at least scan before using this data set (see link, below).
- The CBSA, CSA and MetDiv metro geocodes are now vintage 2013 (current as of 7/14)
- These exact same data are also available in the zctamstr subdirectory where we have one file per state.
),
SortedBy=State zcta5,
CreatePgm=zcta_master12,
SortPrio=1,
urlmeta=%str(https://mcdc.missouri.edu/pub/data/georef/zcta_master.Metadata.html),
keyVars=state county cbsa CBSAtype UA uatype metdiv csa,
keyFmats=state county cbsa | uauc | metdiv csa,
subtype=zctamaster,
debug=0);
%doset(memname=puma_master,memlabel=%str(PUMA master dataset vintage 2013),
geouniv=UnitedStates,Unit=PUMAS,Years=%str(2013),
description=
%str(Comprehensive resource for 2010 (aka 2012) Public Use Microdata Areas (PUMAs) showing
geographic correspondences and recent (2013 1-year) ACS-based demographics),
usageNotes=%nrbquote(- If this looks familiar then maybe you have accessed the zcta_master dataset that is the equivalent
resource for 2010 ZCTAs
- A web app at https://mcdc.missouri.edu/websas/display_pumamaster.html lets you select a state and enter a 5-digit PUMA code. The
application will then display the contents of the puma_master observation for that specified PUMA. It will also display hyperlinks
to two mapping resources to help you see the PUMA.
- We have a special Metatata file that you should at least scan before using this data set (see link, below). Very similar to one
we created for zcta_master.
- The CBSA, CSA and MetDiv metro geocodes are vintage 2013 (current as of 7/14)
- These exact same data are also available in the pumamstr subdirectory where we have one file per state.
),
SortedBy=State puma,
CreatePgm=puma_master12,
SortPrio=2,
urlmeta=%str(https://mcdc.missouri.edu/pub/data/georef/puma_master.Metadata.html),
keyVars=state puma cbsa csa,
keyFmats=state puma cbsa csa,
keyquals=%str(| state | |);
subtype=pumamaster,
debug=0);
===========================End commented out================================ */
%doset(memname=cbsacos,
geouniv=UnitedStates,units=county,years=2015,
description=%nrbquote(The Year variable indicates the CBSA vintage. Pop variables contain recent county estimates.),
createpgm=cbsas15,
UsageNotes=%nrbquote(- Starting in 2017 this set is just an alias for the most recent version, currently cbsacos15.
- Set includes geocodes for Puerto Rico but no pop data.
- Pop data was taken from popests.uscom14 data set. Has 2010 census count and annual post-2010 estimates.
- We recreate this data set whenever the Bureau releases new CBSA definitions.
- All counties are included even those not in CBSAs. The CBSA code is blank for those counties.
- The create file (SAS program) is the one used to create the cbsacos15 set. This dataset is actually created
manually after a new cbsacos is created. We do it by using system (Linus) commands to redefine the soft link so that it
points to the latest set.
),
keyvars=state county cbsa cbsatype year metrodiv csa,
keyfmats=state county cbsa | | metrodiv csa,
setgroup=cbsa,
debug=0)
%doset(memname=cbsacos15,memlabel=%nrbquote(Latest set showing which counties go with what CBSAs),
geouniv=UnitedStates,units=county,years=2015,
description=%nrbquote(The Year variable indicates the CBSA vintage. Pop variables contain recent county estimates.),
createpgm=cbsas15,
UsageNotes=%nrbquote(- Uses the July 2015 CBSA definitions.
- Set includes geocodes for Puerto Rico but no pop data.
- Pop data was taken from popests.uscom14 data set. Has 2010 census count and annual post-2010 estimates.
- All counties are included even those not in CBSAs. The CBSA code is blank for those counties.
),
keyvars=state county cbsa cbsatype year metrodiv csa,
keyfmats=state county cbsa | | metrodiv csa,
setgroup=cbsa,
debug=0)
/*<=========================Comment out=====================================
%doset(memname=cbsas,memlabel=%nrbquote(Latest set showing CBSA codes and names),
geouniv=UnitedStates,units=cbsa,years=2013,
description=%nrbquote(The Year variable indicates the CBSA vintage.),
createpgm=cbsas13,
UsageNotes=%nrbquote(- Includes the CSA code and name where applicable.
- States (note plural) contains list of FIPS state codes indicating the states in which the CBSA is
all or partly contained.
- Nstates counts the number of states the CBSA intersects.
),
keyvars=cbsa cbsatype year csa States,
keyfmats=%str(cbsa | | csa |),
setgroup=cbsa,
debug=0)
%doset(memname=csacbsas,memlabel=%nrbquote(Latest set showing CBSA/CSA codes and names),
geouniv=UnitedStates,units=cbsa within csa,years=2013,
description=%nrbquote(Combined Statistical Areas with CBSA components),
createpgm=cbsas13,
UsageNotes=%nrbquote(- Use this set to see what CBSAs comprise each CSA.
- State variable IDs one state contained in the CBSA. There may be more.
- The set is sorted by CSA.
),
sortedby=csa cbsa,
keyvars= cbsa year csa state,
keyfmats=%str(cbsa | csa state),
setgroup=cbsa,
debug=0)
%doset(memname=metrodivs,memlabel=%nrbquote(Latest set showing Metropolitan Div codes and names),
geouniv=UnitedStates,units=metrodiv within cbsa,years=2013,
description=%nrbquote(Metropolitan Divisions within CBSA),
createpgm=cbsas13,
UsageNotes=%nrbquote(- Use this set to see what CBSAs are divided into Metro Divisions
- State variable IDs one state contained in the CBSA. There may be more.
- The set is sorted by CBSA.
),
sortedby=cbsa MetroDiv,
keyvars= cbsa year csa State,
keyfmats=%str(cbsa | csa state),
setgroup=cbsa,
debug=0)
;
%doset(memname=cbsapops,memlabel=%nrbquote(Latest set showing CBSA 2010 pop and latest Pop Estimate),
geouniv=UnitedStates,units=CBSA,years=2013,
description=%nrbquote(Current CBSAs as of 2/13 with Counties comprising and Pop Data),
createpgm=cbsas13,
UsageNotes=%nrbquote(- Use this set to see the 2010 and latest (2012) pop estimates
- The Counties variable is a list of the counties comprising the CBSA.
),
sortedby=cbsa,
keyvars= cbsa cbsatype,
keyfmats=%str(cbsa | ),
setgroup=cbsa,
debug=0)
;
%let mocogeosyr=14;
%doset(memname=mocogeos&mocogeosyr,
geouniv=Missouri,units=county,years=20&mocogeosyr,
description=%nrbquote(Key resource data set showing 6 current county-based region codes and their names),
createpgm=mocogeosYY,
UsageNotes=%nrbquote(- Starting 7/2014 we use year-specific data sets in place of mocogeos set which is vintage 2010
- The CBSAs in this data set are as of Feb 2013
- We have not yet updated the UMX codes.
- Regions specified: RPC, DED, MoDOT, AAA, CBSA, UMX, MSA2k
- Includes 1990, 2000, and 2010 census pop counts as well as latest estimate.
- Internal point coordinates and AreaSQMI also include.
- The mocogeos data set has vintage 2010 geography. Look for later versions of this data set.
- See the mocogeomaps subdirectory to see maps of the state with the regions shaded.
),
sortedby=county,
keyvars= county,
keyfmats=%str(mocnty),
setgroup=mocogeos,
debug=0)
;
%doset(memname=moblks_ur6,
geouniv=Missouri,units=block,years=2010,
description=%nrbquote(We assigned 6 urban/region categories for urmdc project fall 2014)
createpgm=moblks_ur6,
UsageNotes=%nrbquote(- We start with Urban/Rural and then define 3 levels of each.
- We use the 2010 defn of urban/rural and mix in CBSA and Principal City defns as of 2/13
- We used mable14.mov as base for all variables except URcat. We created esriid from county, tract and block.
- Includes lat-long coordinates and 2010 pop count.
- The file moblks_ur6.csv contains same data in delimited format.
),
sortedby=county tract block,
keyvars= county,
keyfmats=%str(mocnty),
debug=0)
;
%doset(memname=adjacent_counties2010,
geouniv=United States,units=county,years=2010,
description=%nrbquote(Each obs describes a pair of adjacent counties as of 2010),
createpgm=county_adjacency,
UsageNotes=%nrbquote(- This dataset is structured just like the input file from Bureau. Each line of
that file get turned into an observation in this dataset.
- Some of these counties have changed since 2010.
- County and County2 variables are a 5-digit codes. CountyNm and CountyNm2 contain the names of the 2 counties.
- We added State and State2, FIPS codes.
- Check out the companion adjacent_counties2010_collapsed dataset.
- Includes data for PR and territories. Data for Hawaii is here but those counties are islands and have no adjacencies.
- Self-adjacency is represented. Each county has an obs indicating it is adjacent to itself. Waste of space.
),
sortedby=county county2,
setgroup=adjacency,
keyvars=state county,
keyfmats=%str(state county),
debug=0)
;
%doset(memname=adjacent_counties2010_collapsed,
geouniv=United States,years=2010,
description=%nrbquote(Each obs describes a county with adjacent counties IDed in two list-of-values variables),
createpgm=county_adjacency,
UsageNotes=%nrbquote(- This dataset was derived from the companion adjacency_counties2010 dataset.
- Some of these counties have changed since 2010.
- State County and CountyNm describe the base county. Its neighbors are listed in AdjacentFips and AdjacentNames variables.
- Variable Nadjacent is a count of adjacent counties. Can be 0. We do not include a county as a neighbor of itself.
- Names of adjacent counties include the state abbreviation only if they are in a different state. These names are delimited by
a vertical var symbol. AdjacentFips just has blanks as separators.
- Includes data for PR and territories. Data for Hawaii is here but those counties are islands and have no adjacencies.
),
sortedby=county ,
setgroup=adjacency,
keyvars=state county,
keyfmats=%str(state county),
debug=0)
;
*--We ran metafix on this filetype (from /pub/data/system/Tools/invoke_metafix.sas) and now we use the file it generated to do some
updating--;
%*include 'file_dosets.sas' / source2;
===========================End commented out================================ */
proc datasets library=georef nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=georef,debug=1,runprocc=1);