x cd /pub/data/mable2k/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
libname mable2k '/pub/data/mable2k';
%*doset(mode=initialize,
libname=mable2k,memname=akblks,debug=1);
options mprint;
*----Create the template entry for the blks datasets---;
%doset(memname=_template_blks,libname=mable2k,
memlabel=~stname geocodes for census blocks,
geouniv=~stname,
units=Census_Blocks_2000,
Years=2000,
CreatePgm=genmable2k_01,
Keywords=census block geocodes mable geocorr,
Description=%nrbquote(This data has been extracted from the 2000 Census SF1 geographic headers file. It has one row/obs
per census block and has most of the low level geographic codes associated with the block. It also contains the complete
count population and housing unit counts as well as the land area in square miles and the coordinates of an internal point
in latitude, longitude. The best way to access these data for most users will be via the
Geocorr2k web application.),
keyvars=County,
keyfmats=county ,
DataSource=%nrbquote(U.S. Bureau of the Census - Census 2000, Summary File 1),
SortedBy=county tract block,
UsageNotes=%nrbquote(
- The companion datasets, ~stab.cocds1 and
~stab.cocds2, have more geocodes such as State, Region, Division and
various metro area codes which are constant within a county.
- The companion data file (SAS view), ~stab.v2, merges the higher level codes from ~stab.cocds1 and
~stab.cocd2 with this dataset so you get
all the geocodes at the block level.
),
Means =,
Mweights=,
SubType=blks,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(https://mcdc.missouri.edu/data//sf12000/Techdoc/appendix_A.pdf),
filters=,
debug=1);
*----Create the template entry for the blks2 datasets---;
%doset(memname=_template_blks2,libname=mable2k,
memlabel=%str(~stname additional TIGER-based geocodes for census blocks),
geouniv=~stname,
units=Census_Blocks_2000,
Years=2000,
CreatePgm=tiger_codes,
Keywords=census block geocodes mable geocorr ua urban rural tiger puma,
Description=%nrbquote(This data has been extracted from the Census Bureau UA TIGER line files.
It has one row/obs
per census block and geocodes ua (uranized area/urban cluster), UR and UR90 (urban rural codes for 2000 and 1990) as well as
the puma5 code as used in the Bureau Public Use Microdata Sample (PUMS) files, the 5% versions.
The best way to access these data for most users will be via the
Geocorr2k web application.),
keyvars=County ua,
keyfmats=county uauc2k ,
DataSource=%nrbquote(U.S. Bureau of the Census - TIGER/Line Files, UA Census 2000 Version, 2002),
SortedBy=county tract block,
UsageNotes=%nrbquote(- This dataset complements the ~stab.blks dataset which also contains geocodes at the block
level taken from SF1 headers files.
- This is the best place to go when you just want a file showing the UA and/or Urban/Rural status of all blocks within
this state.
- The companion data file (SAS view), ~stab.v2, merges the codes from &stab.blks and the
higher level codes from ~stab.cocds1 and ~stab.cocds2 with this dataset so you get
all the geocodes at the block level.
),
Means =,
Mweights=,
SubType=blks2,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(http://www.census.gov/geo/www/ua/ua_2k.html),
filters=,
debug=1);
options NOmprint;
*----Create the template entry for the cocds1 datasets---;
%doset(memname=_template_cocds1,libname=mable2k,
memlabel=~stname higher level geocodes linked to county codes,
debug=1,
geouniv=~stname,
units=Counties,
Years=2000,
CreatePgm=genmable2k_01,
Keywords=census county geocodes mable geocorr,
Description=%nrbquote(This data has been extracted from the 2000 Census SF1 geographic headers file. It has one row/obs
per county. Geocodes reported are higher level ones that do not change across a county such as US regions and
division and various metropolitan area codes. As with all the data in this collection the easiest way for most users to access it
is using the Geocorr2k web application.),
keyvars=County msacmsa pmsa necma,
keyfmats=county metro metro necma,
keyquals=,
DataSource=%str(U.S. Bureau of the Census - Census 2000, Summary File 1),
SortedBy=county,
Means =,
Mweights=,
SubType=cocds1,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(https://mcdc.missouri.edu/data//sf12000/Techdoc/appendix_A.pdf),
filters=);
*----Create the template entry for the v views (obsolete)---;
%doset(memname=_template_v,libname=mable2k,
memlabel=%str(This view merges ~stab.blks ~stab.blks2 and ~stab.cocods1),
geouniv=~stname,
units=Census_Blocks_2000,
Years=2000,
CreatePgm=genmable2k_01,
Keywords=census block 2000 geocodes mable geocorr,
Description=%nrbquote(This view combines the block level data from the ~stab.blks dataset with the higher level codes
stored in ~stab.cocds1, creating the complete block-level set of geographic codes and data.
As with all the data in this collection the easiest way for most users to access it
is using the Geocorr2k web application.),
keyvars= County CouSubFP PlaceFP sdelm sdsec sduni msacmsa pmsa ua,
keyfmats=county fmcd fplace leaname leaname leaname metro metro uauc2k,
keyquals= | state state state state state | | |,
DataSource=%str(U.S. Bureau of the Census - Census 2000, Summary File 1),
SortedBy=county tract block,
Means =,
Mweights=,
SubType=v,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(https://mcdc.missouri.edu/data//sf12000/Techdoc/appendix_A.pdf),
filters=,
debug=1);
*----Create the template entry for the cocds2 datasets---;
%doset(memname=_template_cocds2,libname=mable2k,
memlabel=%str(~stname cbsa related geocodes (2004) linked to county codes),
debug=0,
geouniv=~stname,
units=Counties,
Years=2004,
CreatePgm=genmable2k_02,
Keywords=census county geocodes mable geocorr,
Description=%nrbquote(This data has been extracted from the georef.cbsacos datset, which documents
the link between counties and core base statistical areas. It has one row/obs
per county. Geocodes reported are the CBSA code, Metropolitan Division code, CSA, cbsatype (Metro, Micro or blank).
As with all the data in this collection the easiest way for most users to access it
is using the Geocorr2k web application.),
keyvars=County CBSA cbsatype csa metrodiv cbsayear,
keyfmats=county cbsa | csa metrodiv | ,
keyquals=,
DataSource=%str(U.S. Bureau of the Census - CBSA Definitions as of 11/04 and posted to web site March, 2005),
SortedBy=county,
Means =,
Mweights=,
SubType=cocds2,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(https://mcdc.missouri.edu/pub/data/georef/metrodefs.nov2004.txt),
filters=);
*----Create the template entry for the v2 views (replaces the obsolete _template_v) ---;
%doset(memname=_template_v2,libname=mable2k,
memlabel=%str(This view merges ~stab.blks ~stab.blks2, ~stab.cocods1 and ~stab.cocods2),
geouniv=~stname,
units=Census_Blocks_2000,
Years=2000,
CreatePgm=genmable2k_02,
Keywords=census block 2000 geocodes mable geocorr,
Description=%nrbquote(This view combines the block level data from the ~stab.blks dataset with the higher level codes
stored in ~stab.cocds1 and ~stab.cocds2, creating the complete block-level set of geographic codes and data.
As with all the data in this collection the easiest way for most users to access it
is using the Geocorr2k web application.),
keyvars= County CouSubFP PlaceFP sdelm sdsec sduni msacmsa pmsa ua cbsa csa metrodiv,
keyfmats=county fmcd fplace leaname leaname leaname metro metro uauc2k cbsa csa metrodiv,
keyquals= | state state state state state | | |,
DataSource=%str(U.S. Bureau of the Census - Census 2000, Summary File 1, Mostly),
SortedBy=county tract block,
Means =,
Mweights=,
SubType=v,
SetGroup=~stab,
VarSet=,
URLMeta=%nrbquote(https://mcdc.missouri.edu/data//sf12000/Techdoc/appendix_A.pdf),
filters=,
debug=1);
options NOmprint;
*---here we define the macro for doing the processing for one state. Then below we use the dostates macro
to invoke this macro once for every state in the U.S. ---;
%macro doit(state,stab);
%let stname=&statenm;
%doset(memname=&stab.blks,template=_template_blks,libname=mable2k)
%doset(memname=&stab.blks2,template=_template_blks2,libname=mable2k)
%doset(memname=&stab.cocds1,template=_template_cocds1,libname=mable2k)
%doset(memname=&stab.cocds2,template=_template_cocds2,libname=mable2k)
%doset(memname=&stab.v2,template=_template_v2,libname=mable2k)
%mend doit;
%dostates(names=1)
/* =======================Begin comment================
%doset(memname=usbbbbs,libname=mable2k,
memlabel=%str(Block based bounding box coords for all US states and counties),
geouniv=UnitedStates,
units=States and Counties,
Years=2000,
CreatePgm=genbbbbs,
Keywords=geocodes block based bounding box,
Description=%nrbquote(This set has data with the coordinate extrema -- minlat, maxlat, minlon, maxlon --
for every state and county in the U.S. (50 states + DC). Based on taking min, max values of internal pt lat long at
the block level off the mable2k state level blocks datasets.),
keyvars= SumLev State County,
keyfmats=Sumlev state county,
DataSource=%str(U.S. Bureau of the Census - Census 2000, Summary File 1),
SortedBy=sumlev state county,
Means =,
Mweights=,
SubType=bbbb,
SetGroup=us,
VarSet=,
filters=,
debug=1);
%doset(memname=usschoolcodes,libname=mable2k,
memlabel=%str(Population summary data for US School Districts),
geouniv=UnitedStates,
units=School Districts,
Years=2000,
CreatePgm=usschoolcodes,
Keywords=school districts urban rural metro population 2000 census,
Description=%nrbquote(By summary the MABLE block level data we create these school district summaries showing
the total urban and metropolitan pop counts from the 2k census, along with the total population. Flag variables Urban2k and
Metro2k are set to 1 if pop is 3/4 urban or metropolitan, respectively. Blocks that are in more than 1 kind of district
(unified, elementary, secondary) get counted more than once (which does not happen in all states).),
UsageNotes=%nrbquote(- The county variable is assigned as the last county to intersect with the district. The
variable NCounties tells you how many counties the district intersects with. A format code of county12. is associated with
the county variable, which is stored as the 5-character FIPS code.
- The Overlap flag variable indicates if any of the district overlaps with other districts of a differenty type.
- The CntySC_Lo abd CntySC-Hi variables contain the lowest and highest size codes for intersecting counties. When the
district is entirely within a single county then obviously these codes will be the same.
),
keyvars= State County SchlName schltype,
keyfmats=State county leaname |,
DataSource=%str(U.S. Bureau of the Census - Census 2000, Summary File 1 and UA Tiger Line Files),
SortedBy=State school,
Means =,
Mweights=,
SubType=school,
SetGroup=usschool,
VarSet=,
filters=,
debug=1);
======================End comment================== */
proc sort data=mable2k.datasets out=bysortprio; by sortprio; run;
proc print data=bysortprio;
by libname notsorted libpath ;
id memname;
var SortPrio SetGroup SubType VarSet URLmeta GeoUniv years CreatePgm CreateLib;
title2 'Listing of Selected Fields from mable2k.datasets (Sorted by SortPrio)';
run ;
proc datasets library=mable2k nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=mable2k,debug=1,runprocc=1);