x cd /pub/data/pl942010/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, March 2011,
-- */
title "Job to Invoke doset Macro for Sets in pl942010, creating pl942010.datasets";
libname pl942010 '/pub/data/pl942010';
%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=pl942010,debug=1);
%macro doit(state,stab);
*----------------------------------------------------------------------;
%doset(mode=,libname=pl942010,
memname=&stab.sums,
geouniv=&statenm,
units=%str(2010 tract, BG, block, VTD, etc),
Years=2010,
CreatePgm=cnvt_many_states,
Keywords=2010 census pl94 redistricting,
Description=%nrbquote(Basic pop counts, by race and hispanic with over-18 detail. Lots of geographic summary lvels. First
sub-state numbers released based on 2010 decennial census.),
keyvars=SumLev county placefp cousubfp cbsa metrodiv,
keyfmats=SumLev county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=Ngeo_id,
UsageNotes=%nrbquote(
- This is the one you want for this state (you do not want the detail set). We have transformed the
raw data as distributed and boiled it down into variables you might want to map or use directly in a report.
- Variables that we created include a Population Per Square Mile (poppsqmi) and a series of Pct variables.
- Geographies are all as of Jan 1, 2010.
- The Readme.html file is really quite helpful regarding these datasets. Especially wrt geographic levels included.
- This is similar to what we did last decade with pl942000.
- We changed our approach to creating these starting March 5, 2011. Before then we were creating views for these data sets.
),
SubType=sums,
SetGroup=,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html),
debug=1);
%doset(mode=,libname=pl942010,
memname=&stab.detail,
geouniv=&statenm,
units=%str(table cell),
Years=2010,
CreatePgm=cnvt_many_states,
Keywords=2010 census pl94 redistricting detail,
Description=%nrbquote(We generated one obs for each non-zero cell of the summary tables giving ua
one obs per geo, race, hispanic and over18),
keyvars=race_id hispanic voteage,
keyfmats= | | |,
sortprio=9,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=Ngeo_id,
UsageNotes=%nrbquote(- The great majority of users can and should ignore the detail datasets.
- All the variables are codes. See the Readme.html file in the pl942010 data directory for an expanation of the variables and
their codes.
- No geocodes are provided. You have to merge by ngeo_id with the corresponding sums data set to get any need geocodes.
),
SubType=detail,
SetGroup=,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html),
debug=1);
%mend doit;
/* ========================begin comment====================================
options mprint;
%***dostates(01 04 05 06 08 09 10 15 16 17 18 19 20 22 24 28 29 31 32 34 37 38 39 40 41 42 46 48 49 50 51 53 55 56,names=1);
==========================end comment====================================== */
*---Do entries for the us and us..._trends datasets---;
%doset(mode=,libname=pl942010,
memname=_template_us,
geouniv=%str(U.S., incl P.R.),
Years=2010,
CreatePgm=pl94_usdatasets,
Keywords=2010 census pl94 national,
Description=%nrbquote(Created by concatenating the specified geographic summary levels from all of the XXsums datasets to
create this nationwide dataset),
keyvars=SumLev State,
keyfmats= sumlev state,
sortprio=1,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=state,
SubType=sums,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html),
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=usstates,
usageNotes=Data for all the states and Puerto Rico,
units=state);
%doset(libname=pl942010,template=_template_us,
memname=uscounties,
usageNotes=%str(Includes county equivalents such as parishes in LA and independent cities in several states),
units=county);
%doset(libname=pl942010,template=_template_us,
memname=usplaces,
units=%str(place place/county),
sortedby=state placefp,
keyvars=SumLev State lsadc county,
keyfmats= sumlev state lsadc county,
UsageNotes=%nrbquote(- Includes data for all places in the U.S. regardless of population.
- Has two summary levels: 160 for complete place summaries and 155 for county portions of places.
- Even when a place is in only one county there will be redundant summaries at both 155 and 160 levels.
- The places160 dataset (view) is basically just this dataset with the 155-level summaries removed.
),
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=usplaces10k,
description=%str(Summaries for 3,907 complete places with minimum 10,000 population in the entire U.S.),
units=%str(place (10k pop min)),
sortedby=state placefp,
keyvars=SumLev State lsadc,
keyfmats= sumlev state lsadc,
UsageNotes=%nrbquote(- Includes data for all places in the U.S. with a minimum population of 10,000.
- Has data for complete places only. No county-within place summaries as are available on the usplaces dataset.
),
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=usplaces160,
description=%str(Summaries for all 29,415 complete places, regardless of size, in the U.S.),
units=place,
sortedby=state placefp,
keyvars=SumLev State lsadc,
keyfmats= sumlev state lsadc,
UsageNotes=%nrbquote(- Includes data for all places in the U.S. regardless of population.
- Has data for complete places only. No county-within place summaries as are available on the usplaces dataset.
),
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=uscousubs,
sortedby=state county cousubfp,
UsageNotes=%nrbquote(- Includes data for all county subdivisions in the U.S.
- Has the single summary levels 060. There are lots of different kinds of geographic entities that are used
as county subs, such as towns, townships, CCDs and even cities.
),
units=%str(county subdivisions),
keyvars=state county lsadc,
keyfmats=state county lsadc,
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=netowns, sortprio=5,
description=%str(This is just a subset of the uscousubs dataset for the six states making up New England),
sortedby=state county cousubfp,
UsageNotes=%nrbquote(- Includes data for all county subdivisions ("towns") in New England.
- We put these in a separate dataset because these geographic entities take on great importance in New England.
),
units=towns,
keyvars=state county lsadc,
keyfmats=state county lsadc,
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=uscbsas,
description=%str(Aggregated Core Based Statistical Area summaries for entire U.S.),
sortedby=cbsa state,
UsageNotes=%nrbquote(- CBSA (Core-Based Statistical Area) is an umbrella term for Metropolitan and Micropolitatan
Statistical Area.
- Each CBSA code will appear at least twice on this dataset. The first occurrence is a level 310 summary, which is a
complete CBSA. This will be followed immediately by level 311 summaries, which are state portions of CBSAs. Even if the CBSA is
contained in a single state you will get a redundant 311 summary for the state portion.
- These CBSAs are based on the codes provided in the PL94 headers, which are vintate November 2009.
- We had to aggregate county level data to get these summaries, since there were no 310 or 311 summaries on PL94.
- There are CBSA codes of 99999 at the end, which are summaries for the portions of states where no CBSA is defined.
- The variable cbsatype has values of "metro", "micro" and " " to indicate the type of CBSA being summarized.
- Do not look for NECTAs in this dataset.
),
units=%str(CBSA, complete and within-state),
keyvars=sumlev cbsa state cbsatype,
keyfmats=sumlev cbsa state |,
debug=0);
%doset(libname=pl942010,template=_template_us,
memname=usregdiv,
description=%str(Aggregated data to summarize the nation and its regions and census divisions),
sortedby=sumlev,
UsageNotes=%nrbquote(- These big picture geographies were not published as part of the PL94 data, so we had to aggregate
state level data to get them.
- Useful for doing comparison to see how a state or sub-state area compares with the nation or a region.
),
units=%str(United States, Census Regions, Divisions),
keyvars=sumlev,
keyfmats=sumlev,
debug=0);
%doset(mode=,libname=pl942010,
memname=_template_ustrends,
geouniv=%str(U.S., incl P.R.),
Years=2000 2010,
CreatePgm=pl94_ustrend_datasets,
Keywords=2010 census pl94 national 2000 trends,
keyvars=SumLev State,
keyfmats= sumlev state,
sortprio=2,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=state,
SubType=trends,
SetGroup=us,
VarSet=,
URLMeta=,
debug=0);
%doset(libname=pl942010,template=_template_ustrends,
memname=uscbsa_trends,
description=%str(Aggregated Core Based Statistical Area summaries with 2000-SF1 trend data for entire U.S.),
sortedby=cbsa state,
UsageNotes=%nrbquote(- CBSA (Core-Based Statistical Area) is an umbrella term for Metropolitan and Micropolitatan
Statistical Area.
- Each CBSA code will appear at least twice on this dataset. The first occurrence is a level 310 summary, which is a
complete CBSA. This will be followed immediately by level 311 summaries, which are state portions of CBSAs. Even if the CBSA is
contained in a single state you will get a redundant 311 summary for the state portion.
- These CBSAs are based on the codes provided in the PL94 headers, which are vintate November 2009. Both the 2000 and 2010
data are summarized using the same CBSA defns.
d
- We had to aggregate county level data to get these summaries, since there were no 310 or 311 summaries on PL94 nor on SF1.
- There are CBSA codes of 99999 at the end, which are summaries for the portions of states where no CBSA is defined.
- The variable cbsatype has values of "metro", "micro" and " " to indicate the type of CBSA being summarized.
- Do not look for NECTAs in this dataset.
),
units=%str(CBSA, complete and within-state),
keyvars=sumlev cbsa state cbsatype,
keyfmats=sumlev cbsa state |,
debug=0);
%doset(libname=pl942010,template=_template_ustrends,
memname=uscnty_trends,
memlabel=%str(County level trends for the entire U.S. incl P.R.),
keyvars=sumlev state county cbsa,
keyfmats=sumlev state county cbsa,
usageNotes=%str(- Includes county equivalents such as parishes in LA and independent cities in several states
- Some counties could not be matched on the 2000 data file (derived from Summary File 1). This happened for several counti
es in Alaska, Broomfiled, CO and Clifton Forge, VA
- Data from the 2000 census is indicated by a 2k suffix on the variable name,
- We used data from sf12000x.uscntys for the 2k variables. That dataset also contained a totpop90 variable that we added
back in 2001. The variables Change10 and Change20 measure the population change over 10 and 20 years.
),
units=county);
proc sort data=pl942010.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 pl942010.datasets (Sorted by SortPrio)';
run ;
proc datasets library=pl942010 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options NOmprint msglevel=i;
%gendshtm(libname=pl942010,debug=1,runprocc=0);