x cd /pub/data/sf12010/Tools; %let pgm=invoke_dosetsus; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, June, 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=usregdiv;
%***let todo=usplaces usplaces160 usplaces10k; *<=======================NOTE===============================;
*-----Run this step ONLY ONCE------------------------------------------;
*----If you need to rerun (start over) then delete the datasets dataset first. doset will not
allow initialize mode if the datasets set already exists.---;
%***doset(mode=initialize,
libname=sf12010,debug=1);
%macro doit(state,stab);
*----------------------------------------------------------------------;
%doset(mode=,libname=sf12010,
memname=&stab.blocks,
geouniv=&statenm,
units=%str(census block),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed tables blocks,
Description=%nrbquote(Detailed 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),
SortedBy=county cousubfp placefp tract bg block,
UsageNotes=%nrbquote(
- This is one of a set of seven data sets created for &statenm.. This is the only set with
block level data (SumLev=101).
- This data set is several times larger than all the other data sets for this state combined. Avoid downloading an entire state.
- Data set has only P and H tables. There are no PCT or HCT tables at this small level.
- Naming convention for table items is the MCDC table-naming 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 PHlabels.txt file for variable detail.
),
SubType=block,
SetGroup=&stab,
VarSet=variablesph,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.bgs091,
geouniv=&statenm,
units=%str(Bg split by county sub and place),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed tables hierarchal block groups,
Description=%nrbquote(Detailed tables for &statenm split Block Groups),
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),
SortedBy=county cousubfp placefp tract bg,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. This is the only set with
this block-group level data (SumLev=091). See the &stab.bgs150 data set for data complete BG data summaries.
- Data set has only P and H tables. There are no PCT or HCT tables at this small level.
- Naming convention for table items is the MCDC table-naming 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 PHlabels.txt file for variable detail.
),
SubType=bgs091,
SetGroup=&stab,
VarSet=variablesph,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.bgs150,
geouniv=&statenm,
units=%str(block groups),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed tables complete block groups,
Description=%nrbquote(Detailed tables for &statenm Block Groups),
keyvars=county cbsa metrodiv,
keyfmats=county cbsa metrodiv,
keyquals=%str(| | | ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=county tract bg,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. This is the only set with
this block-group level data (SumLev=150). See the &stab.bgs091 data set for split BG data summaries.
- PlaceFP and CouSubFP are blank on these summaries since complete BGs do not nest within those levels.
- Data set has only P and H tables. There are no PCT or HCT tables at this small level.
- Naming convention for table items is the MCDC table-naming 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 PHlabels.txt file for variable detail.
),
SubType=bgs150,
SetGroup=&stab,
VarSet=variablesph,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.hierarchal,
geouniv=&statenm,
units=%str(many hierarchal levels),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed tables hierarchal levels,
Description=%nrbquote(Detailed P, H, PCT and HCT tables for &statenm hierarchal summary levels),
keyvars= sumlev state county placefp cousubfp cbsa metrodiv,
keyfmats=sumlev state county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. It contains a wide variety of
geographic summary levels that we categorized as hierarchal, meaning that is is a level formed by combining two or more basic
levels. E.g. a summary for place within county subdivision (SumLev=070) is found on this hierarchal set, while summary for complete
places (SumLev=160) and country subdivisions (SumLev=060) will be found on the &stab.inventory data set.
- This data set has P, H, PCT and HCT tables. Except that PCT and HCT tables that have alpha suffixes to indicate a race/ethnic
subuniverse are omitted, and can be found on the &stab.phctr data set. (The two data sets can be merged by LogRecNo).
The PCO tables, available for only a few geogrphic levels, are also omitted from this data set as well.
- Naming convention for table items is the MCDC table-naming 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 and
PHCTlabels.txt files for variable detail.
),
SubType=hierarchal,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.inventory,
geouniv=&statenm,
units=%str(many inventory levels such as state, county, place and tract),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed tables inventory summary levels,
Description=%nrbquote(Detailed P, H, PCT and HCT tables for &statenm inventory summary levels),
keyvars= sumlev state county placefp cousubfp cbsa metrodiv,
keyfmats=sumlev state county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. It contains a wide variety of
geographic summary levels that we categorized as inventory. See the values of key variable SumLev to see what these are.
- This is probably the most commonly-accessed and useful of the seven data sets. Here is where you get summary data for all
states, counties, cities, metro areas, ZCTAs, census tracts, school districts, etc. within the universe.
- This data set has P, H, PCT and HCT tables. Except that PCT and HCT tables that have alpha suffixes to indicate a race/ethnic
subuniverse are omitted, and can be found on &stab.phctr data set. (The two data sets can be merged by LogRecNo).
The PCO tables, available for only a few geogrphic levels, are also omitted from this data set as well.
- Naming convention for table items is the MCDC table-naming 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 and
PHCTlabels.txt files for variable detail.
),
SubType=inventory,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.phctr,
geouniv=&statenm,
units=%str(all units census tract and larger),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed CT tables with alpha suffixes,
Description=%nrbquote(PCT tables with alpha suffixes for all &statenm summary levels except sub-tract),
keyvars= sumlev state county placefp cousubfp cbsa metrodiv,
keyfmats=sumlev state county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. This is the only one of the
seven that contains these tables. They are PCT tables which are repeated for race and ethnic groups. E.g. PCT12A thru PCT12O .
- The "h" in the name could imply that it also includes HCT tables with alpha suffixes, which it would -- if there were
any such tables, but there are none.
- Geographically this set has the same areas summarized as the combination of &stab.inventroy and &stab.hierarchal .
- Note that simple P and H tables with alpha suffices are not included here. E.g. table P12A is not found here.
- You can merge this data set with either &stab.inventory or &stab.hierarchal using LogRecNo as the merge key.
- Naming convention for table items is the MCDC table-naming standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. p12Ai15 is the 15th cell in table P12A.
- See the PHCTRlabels.txt
file for variable detail.
),
SubType=phctr,
SetGroup=&stab,
VarSet=variablesphctr,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%doset(mode=,libname=sf12010,
memname=&stab.pcos,
geouniv=&statenm,
units=%str(state county cbsa csa cd slds),
Years=2010,
CreatePgm=cnvtsf1,
Keywords=2010 census detailed CT tables with alpha suffixes,
Description=%nrbquote(Special PCO tables with Group Quarters detail for higher level geographic areas),
keyvars= sumlev state county cbsa csa,
keyfmats=sumlev state county cbsa csa,
keyquals=,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(- This is one of a set of seven data sets created for &statenm.. This is the only one of the
seven that contains these tables. They are PCO tables with detailed breakdowns of the population living in Group Quarters.
- Geographically this set has a very limited set of higher level geographic areas. It includes summaries for state legislative
districts (as defined in 2010).
- You can merge this data set with either &stab.inventory or &stab.hierarchal using LogRecNo as the merge key. But only a small
number of the observations on those two larger data sets will be matched on this set.
- Naming convention for table items is the MCDC table-naming standard:
<TableId>i<cell#>,
where TableID is the table ID and cell# is the cell or item number within the table.
E.g. pco2i3 is the 3rd cell in table PCO2.
- See the PCOlabels.txt
file for variable detail.
),
SubType=pco,
SetGroup=&stab,
VarSet=variablespco,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
%mend doit;
/* ========================begin comment====================================
%**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)
%doset(mode=,libname=sf12010,
memname=usregdiv_aggregated,
memlabel=%str(US Totals, Regions and Divisions),
geouniv=United States,
units=%str(Nation Region Division), sortprio=3,
Years=2010,
CreatePgm=agg_sf12010,
Description=%nrbquote(Detailed P, H, PCT, PCTr, and HCT tables for US etc),
keyvars= sumlev,
keyfmats=sumlev,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=sumlev region division,
UsageNotes=%nrbquote(- This was the first time we aggregated full SF1 data sets.
- Input to agg was a combination of 51 concatended XXinventory and XXphctr data sets.
So this dataset includes tables pct12A thru PCT12I, etc.
- Naming convention for table items is the MCDC table-naming 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,
PHCTRlabels.txt and
PHCTlabels.txt files for variable detail.
),
SubType=aggall,
SetGroup=us,
VarSet=variables,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/sf1pdf),
debug=0);
==========================end comment====================================== */
%*------------------------------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 --;
%doset(mode=,libname=sf12010,
memname=us_template,
memlabel=%str(US Totals, Regions and Divisions),
geouniv=United States,
units=%str(Nation Region Division), sortprio=3,
Years=2010,
CreatePgm=agg_sf12010,
Description=%nrbquote(Detailed P, H, PCT, PCTr, and HCT tables for US etc),
keyvars= sumlev,
keyfmats=sumlev,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=sumlev region division,
UsageNotes=%nrbquote(- This was the first time we aggregated full SF1 data sets.
- Input to agg was a combination of 51 concatended XXinventory and XXphctr data sets.
So this dataset includes tables pct12A thru PCT12I, etc.
- Naming convention for table items is the MCDC table-naming 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,
PHCTRlabels.txt and
PHCTlabels.txt files for variable detail.
),
SubType=aggall,
SetGroup=us,
VarSet=variables,
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 ;
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);
%include sascode(notify);