x cd /pub/data/sf12010/Tools; %let pgm=invoke_dosetsus; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations for the new (12-11) us (national) sets in the Datasets dataset for this directory.
This is a sequel to the invoke_dosets.sas setup.
J. Blodgett, OSEDA, December, 2011,
-- */
title "Job to Invoke doset Macro for us Sets in sf12010, adding to sf12010.datasets";
libname sf12010 '/pub/data/sf12010';
libname sf1 (sf12010);
%let libnameg=sf12010;
%**let todo=uscousubs usplaces;
%*------------------------------Here we add entries for all the datasets that were created by setup cnvtsf1_national.sas . Some
of these sets were created earlier as views that accessed all the states but it is faster to access these national data sets(by far)
jgb, 12-7-11 --;
/* ========================begin comment====================================
%doset(mode=,libname=sf12010,
memname=_template_us,
memlabel=,
geouniv=%str(United States + PR),
units=~gunits, sortprio=2,
Years=2010,
CreatePgm=cnvtsf1_national,
Description=%nrbquote(Detailed P, H, PCT, and HCT tables for ~gunits),
keyvars= sumlev state,
keyfmats=sumlev state,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=,
SubType=aggall,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
==========================end comment====================================== */
%let gunits=Nation States Regions Divisions;
%doset(mode=,libname=sf12010,
memname=usregdivstates,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for the nation, states, census Regions and Divisions),
keyvars= sumlev geocomp state,
keyfmats=sumlev geocomp state,
UsageNotes=%nrbquote(
- Includes lots of geographic component summaries.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=American Indian & Alaska Native Areas;
%doset(mode=,libname=sf12010,
memname=usamindianetc,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for a myriad of tribal units),
keyvars= sumlev state lsadc,
keyfmats=sumlev state lsadc,
UsageNotes=%nrbquote(
- Lots of hierarchal summaries of sub-parts of tribal areas. Areaname pertains to the last geo in the hierarchy.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- There are no geographic components of these areas, i.e. geocomp is always 00.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=Congressional Districts (111th) and State Leg Districts (2010);
%doset(mode=,libname=sf12010,
memname=uscdslds,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for old (as of 1-1-10) Cong Districts and State Leg Dsts),
keyvars= sumlev state,
keyfmats=sumlev state,
UsageNotes=%nrbquote(- These are the 111th congressional districts corr to those elected in 2008.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=Counties;
%doset(mode=,libname=sf12010,
memname=uscounties,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for US Counties and Equivalents),
keyvars= sumlev state cbsa csa metrodiv lsadc,
keyfmats=sumlev state cbsa csa metdiv lsadc,
UsageNotes=%nrbquote(
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- There are no geographic components of these areas, i.e. geocomp is always 00.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=County Subdivisions;
%doset(mode=,libname=sf12010,
memname=uscousubs,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for US County Subdivisions),
keyvars= sumlev state county cbsa csa metrodiv lsadc,
keyfmats=sumlev state county cbsa csa metdiv lsadc,
UsageNotes=%nrbquote(- These areas vary by state as to what they are called. Towns and townships, mostly. AKA MCDs
or Minor Civil Divisions.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=cbsas csas metrodivs etc;
%doset(mode=,libname=sf12010,
memname=usmetros,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for various metro area geographic entities as of 1-1-10),
keyvars= sumlev geocomp state county cbsa csa metrodiv lsadc,
keyfmats=sumlev geocomp state county cbsa csa metdiv lsadc,
UsageNotes=%nrbquote(- Includes Core Based Statistical Areas (CBSAs), CSAs, NECTAs etc. Complete and within-state.
- Note the geographic component sub-summaries for the 310-complete CBSA data.
- The 310 and 311 summaries will be redundant for CBSAs contained in a single state.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=places;
%doset(mode=,libname=sf12010,
memname=usplaces,template=_template_us,
memlabel=,
units=&gunits,
keyvars= sumlev state county cbsa csa metrodiv lsadc ,
keyfmats=sumlev state county cbsa csa metdiv lsadc ,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for places (cities) and place/county areas as defined on 1-1-10.),
UsageNotes=%nrbquote(
- For level 155 (place within county) you get redundant summaries for places contained on one county,
- There are no unincorporated-remainder 155 summaries on this dataset.
- All county-based geocodes will be blank on complete-place (level 160) summaries.
- We replaced the Areaname value on level 155 summaries with the place name instead of the county name.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
*** options mlogic mprint;
%let gunits=ZCTAs;
%doset(mode=,libname=sf12010,
memname=uszips,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed P(CT) and H(CT) tables for 5-digit ZIP Census Tabulation Areas (ZCTAs)),
keyvars= sumlev state county ,
keyfmats=sumlev state county ,
UsageNotes=%nrbquote(- ZCTAs closely resemble but are not identical to ZIP codes.
See https://mcdc.missouri.edu/reports/geography/ZIP.resources.html#zctas.
- Lots of wasted space and redundancy here with the 3 summary levels (complete ZCTA, ZCTA-State and
ZCTA-county.) Because nearly all ZCTAs are in a single state and over 90 pct of ZCTAs are in a single county.
- There are no summaries for XX and HH pseudo-ZCTAs this decade.
- All county-based geocodes will be blank on all but 880 (ZCTA-county) summaries.
- Areaname values are pretty worthless. The 860 levels have "ZCTA5 xxxxx" while the 870 & 880 summaries use the state/cnty name.
- Does not include suffix-modified PCT tables such as tables pct12A thru PCT12I, which are on the usphctr dataset.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p7i5 is the 5th cell in table P7.
- See the PHlabels.txt,
PHCTlabels.txt files for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%let gunits=all sf12010 national levels;
%doset(mode=,libname=sf12010,
memname=usphctr,template=_template_us,
memlabel=,
units=&gunits,
Description=%nrbquote(Detailed pct<r> tables (repeated for pop subgroups) for all geographies in US),
keyvars= sumlev geocomp state county ,
keyfmats=sumlev geocomp state county ,
UsageNotes=%nrbquote(- These are important tables for demographers but not always of great general interest.
- There are only 6 x 15= 90 tables (6 basic sets of info repeated for each of 15 subgroups) but over 4000 data cells.
- One of the largest data sets in the MCDC archive.
- Naming convention for table items is the MCDC standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. the first cell in table PCT12I is named PCT12Ii1 .
- See the PHCTRlabels.txt
file for variable detail.
),
SubType=phct,
SetGroup=us,
VarSet=variablesr,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
proc sort data=sf12010.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 sf12010.datasets (Sorted by SortPrio)';
run cancel;
proc datasets library=sf12010 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options NOmprint msglevel=i;
%gendshtm(libname=sf12010,debug=0,runprocc=0);