x cd /pub/data/popests/Tools; %let pgm=invoke_dosets19; filename pgm "&pgm..sas";
/*
Invoke the %doset macro to create observations in the Datasets dataset for this directory.
4/12 for vintage 2011 com datasets.
3/13 for vintage 2012 com datasets.
5/13 for vintage 2012 sc (place et al) datasets.
3/14 for vintage 2013 com datasets.
5/14 for vintage 2013 sc datasets.
3/15 for vintage 2014 com datasets.
5/15 for vintage 2014 sc and huest data sets.
12/15 for vintate 2015 usnst (nation & state) estimates through 2015.
3/16 for vintage 2015 com datasets.
3/17 for vintage 2016 com datasets.
5/17 for vintage 2016 sc and huests.
6/17 for vintate 2016 usnst (nation & state) estimates
We also document the decade-of-change dataset uscom00_10 here. 8-27-12.
*/
title "Job to Invoke doset Macro for Sets in popests, creating popests.datasets";
%include '/pub/sas/autoexec.sas';
options mprint nosymbolgen;
%let libnameg=popests;
%let scmonth=May; *<===month in which sc estimates were released. Used in Source value--;
libname popests '/pub/data/popests';
*-----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=popests,debug=1);
*----------------------------------------------------------------------;
%let Gyear = 2020; *<====================================== CHANGE ;
%let gyr=%substr(&gyear,3,2);
%let gbyear=2010;
%let yearp1= %eval(&Gyear + 1);
%let gyr=%substr(&gyear,3,2);
%let yearm1= %eval(&Gyear - 1);
%let todolist=uscom&gyr mocom&gyr mocom&gyr.t mocomregns&gyr mohuest&gyear uscomcbsas&gyr mosc&gyr ussc&gyr;
%*let todolist=ussc&gyr mosc&gyr ushuest&gyear uscomnst&gyr;
/*<=========================Comment out=====================================
%*let todolist=uscom00_10;
%*let todolist=ussc12 mosc12;
%*let todo=ushuest2012 mohuest2012;
%let todo=ushuest2013 mohuest2013;
%let todolist=uscomnst15;
===========================End commented out================================ */
%doset(mode=,libname=popests,
memname=_template_uscom,
geouniv=UnitedStates,
units=state county,
Years=%str(2010-~Gyear),
CreatePgm=uscom20YY.cnvt,
Keywords=Population estimates county components of change migration births deaths time series post 2010,
Description=%nrbquote(Estimates of the total pop of counties, states and the US for July 1 of each year from
2010 to ~Gyear. along with annual birth, death, international and domestic migration estimates (the components of change).),
keyvars=SumLev state county cbsa,
keyfmats=SumLev state county cbsa,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released in spring, ~yearp1),
SortedBy=State County,
UsageNotes=%nrbquote(
- Variables that do not have a time indicator are for July 1, ~Gyear or for the
period 4-1-2010 to 7-1-~Gyear. So Popest is the latest estimate and Births is the estimated total births over the
period.
- Most variables have a base name and a time indicator suffix. The base names are Pop (total pop), PopC (population change), BRTH, DTH (birth and death), IMIG, DMIG, NetMig (international, domestic and net migration) and RSDL (residual). The time indicator suffix can be JLyy, where yy is a two-digit year (the first two digits of the year are assumed to be 20), a single year span such as 1011 (the one-year period from 7-1-2010 through 7-1-2011) or AJ10, indicating the quarterly period April through June, 2010.
- The two variables with 1yr suffixes represent the change and percent change in the pop estimate over the most recent one-year period.
- The rank variables are assigned based on the values of key variables, with lowest rank corresponding to highest values. Thus, if rankch1y=1 for a county, it means that PopCh1yr for that county was the highest in the nation. If
rankpop=7 for a state, it indicates that state had the 7th highest population estimate in the current year (~Gyear).
),
SubType=1com,
SetGroup=us,
URLmeta=%str(https://mcdc.missouri.edu/pub/data/popests/CO-EST~gyear-alldata.pdf),
VarSet=,
debug=0);
%doset(mode=,libname=popests,
memname=_template_mocom,
geouniv=Missouri,
units=state county,
Years=%str(2010-~Gyear),
CreatePgm=uscom20YY.cnvt,
Keywords=Population estimates county components of change migration births deaths time series post 2010 Missouri,
Description=%nrbquote(Estimates of the total pop of Missouri counties and the state for July 1 of each year from
2010 to ~Gyear. along with annual birth, death, international and domestic migration estimates (the components of change).),
keyvars=SumLev state county cbsa,
keyfmats=SumLev state county cbsa,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released circa April, ~yearp1),
SortedBy=County,
UsageNotes=%nrbquote(- This dataset (view) is just a geographic subset of the uscom dataset for the same year.
- Variables that do not have a time indicator are for July 1, ~Gyear or for the
period 4-1-2010 to 7-1-~Gyear. So Popest is the latest estimate and Births is the estimated total births over the
period.
- Most variables have a base name and a time indictor suffix. The base names are Pop (total pop), PopC (population change),
BRTH , DTH (birth and death) , IMIG, DMIG, NetMig (intermational, domestic and net
migration) and RSDL (residual). The time indicator suffix can be JLyy, where yy is a 2-digit year (the
1st 2 digits of the year are assumed to be 20), a single year span such as 1011 (the 1 year period from 7-1-2010 through
7-1-2011) or AJ10, indicating the quarterly period April through June, 2010.
- The 2 variables with 1yr suffixes represent the change and pct change in the pop estimate over the most recent
1-year period.
- The rank variables are assigned based on the values of key variables for all states or counties in the U.S. (NOT just Mo)
, with lowest rank corresponding to highest values.
),
SubType=1com,
SetGroup=mo,
URLmeta=%str(https://mcdc.missouri.edu/pub/data/popests/CO-EST~gyear-alldata.pdf),
VarSet=,
debug=0);
%doset(libname=popests,memname=_template_mocomt,
geouniv=Missouri,units=variable,
Years=%str(2010-~Gyear),
CreatePgm=uscom20YY.cnvt,
Description=%nrbquote(This is the mocom~gyr data set transposed so that the rows are the data items and each column contains
data for 1 geographic area.),
UsageNotes=%nrbquote(- The names of the variables on this data set are of the form c29XXX, where XXX is a 3-digit FIPS county code.
- The labels for the variables are the names of the areas (Missouri, Adair, Andrew, etc.)
),
keyvars=variable,
keyidvars=Item_description,
SubType=1com,
SetGroup=mo,
URLmeta=%str(),
VarSet=,
debug=0);
%doset(libname=popests,memname=_template_mocomregns,
geouniv=Missouri,units=rpc ded umx dot aaa cbsa etc,
Years=%str(2010-~Gyear),
CreatePgm=aggpopests_moregns,
Description=%nrbquote(We aggregated the corresponding Missouri county level dataset to create these region totals),
UsageNotes=%nrbquote(- Region types are CBSA, Area Agency on Aging, DED Regions, MoDOT Regions, Metro Type, RPC,
Urban Influence Code (ERS) and UM Extension Region.
- The basis of the linking of county codes to these regions is dataset georef.mocogeos, which we try to always keep current.
),
keyvars=sumlev cbsa ,
keyfmats=sumlev cbsa ,
SubType=1com,
SetGroup=mo,
URLmeta=%str(),
VarSet=,
debug=0);
%doset(libname=popests,memname=_template_uscomcbsas,
geouniv=United States,units=cbsa US,
Years=%str(2010-~Gyear),
CreatePgm=aggpopests_uscbsas,
Description=%nrbquote(We aggregated the corresponding US county level dataset to create these Core Based Statistical Area totals),
UsageNotes=%nrbquote(- CBSA is an umbrella term for Metropolitan and Micropolitan Statistical Areas
- First obs is US totals. Others are complete CBSAs (Sumlev=310) or CBSA-State (Sumlev=311).
- At the end of the dataset are a series of 311 level 99999-xx summaries of the non-metro remainders of each of the 46 states with a non-metro county.
- The variable State is only defined for 311 within-state summaries. Variable States (plural) contains a list of all states intersected by the CBSA.
- The CBSA codes are linked to counties via merge with georef.cbsacos, a dataset that is rewritten when codes are updated.
),
keyvars=sumlev cbsa state ,
keyfmats=sumlev cbsa state,
SubType=1com,
SetGroup=us,
URLmeta=%str(),
VarSet=,
debug=0);
%doset(mode=,libname=popests,
memname=_template_ussc2,
geouniv=UnitedStates,
units=place county mcd,
Years=%str(2010-~Gyear),
CreatePgm=ussccnvt20YY,
Keywords=Population estimates subcounty place mcd time series post 2010,
Description=%nrbquote(Estimates of the total pop of places (cities) and other sub-county governmental units.
The 2010 census count and an adjusted estimate base figure are provided along with July 1 estimates for each year starting
with 2010 and ending with ~Gyear.),
keyvars=SumLev state county placefp ,
keyfmats=SumLev state county fplace,
keyquals=| | | state ,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released circa ~scmonth, ~yearp1),
SortedBy=State,
UsageNotes=%nrbquote(- While referred to as the "subcounty" estimates, this dataset also contains summaries for
counties and states. In addition to summaries
for complete places and MCDs, it contains summaries for these areas within county.
- The popestBase figure may differ from the pop10c published Census count for various reasons, including CQR adjustment or
because of post-census annexation or deannexation. PopChang and PctChang are based on using popestBase and will thus not
reflect growth or shrinkage based on expanding or contracting a jurisdictions boundaries.
- The place level data does not include CDPs (Census Designated Places).
- The pseudo-code 99990 for placefp (FIPS place code) indicates a summary for the unincorporated remainder of a county.
),
SubType=2sc,
SetGroup=us,
VarSet=,
URLMeta=,
debug=1);
%doset(mode=,libname=popests,
memname=_template_mosc2,
geouniv=Missouri,
units=place county mcd,
Year=%str(2010-~Gyear),
CreatePgm=ussccnvt20YY,
Keywords=Population estimates subcounty place mcd time series post 2010 Missouri,
Description=%nrbquote(Estimates of the total pop of places (cities) and Minor Civil Divisions
in 22 Missouri counties where the county subdivsions are also governmental units.
The 2010 census count and an adjusted estimate base figure are provided along with July 1 estimates for each year starting
with 2010 and ending with ~Gyear.),
keyvars=SumLev state county placefp ,
keyfmats=SumLev state county fplace,
keyquals=| | | state ,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released circa ~scmonth, ~yearp1),
UsageNotes=%nrbquote(- In addition to summaries
for complete places, this dataset also contains summaries for places within county and (in those counties
that have Minor Civil Divisions) within MCD.
- Only 22 counties in Missouri have MCDs (County subdivisions that are functioning governmental units). They are:
Barton Bates Caldwell Carroll Chariton Dade Daviess DeKalb Dunklin Gentry Grundy
Harrison Henry Linn Livingston Mercer Nodaway Putnam Stoddard Sullivan Texas and Vernon.
- The popestBase figure may differ from the published Census count (pop10c) for various reasons, including CQR adjustment or
because of post-census annexation or deannexation. PopChang and PctChang are based on using popestBase and will thus not
reflect growth or shrinkage based on expanding or contracting a jurisdictions boundaries.
- The place level data does not include CDPs (Census Designated Places).
- The pseuo-code 99990 for placefp indicates a summary for the unincoporated remainder of a county.
),
SubType=2sc,
SetGroup=mo,
VarSet=,
URLMeta=,
debug=0);
%doset(libname=popests, memname=uscom&gyr, template=_template_uscom, sortprio=0);
%doset(libname=popests, memname=mocom&gyr, template=_template_mocom, sortprio=0);
%doset(libname=popests, memname=mocom&gyr.t, template=_template_mocomt, sortprio=0);
%doset(libname=popests, memname=mocomregns&gyr, template=_template_mocomregns, sortprio=0);
%doset(libname=popests, memname=uscomcbsas&gyr, template=_template_uscomcbsas, sortprio=0) ;
%doset(mode=,libname=popests, memname=mosc&gyr,template=_template_mosc2)
%doset(mode=,libname=popests, memname=ussc&gyr,template=_template_ussc2)
%doset(mode=,libname=popests,
memname=uscom00_10,
geouniv=UnitedStates,
units=state county,
Year=%str(2000, 2010),
CreatePgm=uscomp2000_2010,
Keywords=Population estimates state county 2000 2010 components change natural increase net migration,
Description=%nrbquote(Combine Evaluation estimates and the latest post-2010 comps to get April 1 to April 1 decade changes),
keyvars=SumLev state county cbsa,
keyfmats=SumLev state county cbsa,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Evaluation ests for 4-1-00 through 7-1-10),
UsageNotes=%nrbquote(- We estimated net migration over the decade by looking at Birth and death counts over
the periods 4-1-2000 through 7-1-2010 (evaluation ests), and the uscom11 post-censal birth and death data for April-June 2010.
- We calculated Natural Increase for the decade between the two censuses and estimated Net Migration by subtraction of NI from Total Change.
- We have "shown our work" by keeping the B & D counts from the two data sources as well as the final calculated values.
- CBSA codes, names and types vintage 2009 are kept on the county summary records.
),
SubType=1com, sortprio=2,
SetGroup=us,
VarSet=,
URLMeta=%str(http://www.census.gov/popest/research/eval-estimates/eval-est.html),
debug=0);
%doset(mode=,libname=popests,
memname=ushuest&gyear,geouniv=United States,units=%str(county state nation),
Years=%str(&gbyear-&gyear),CreatePgm=huestsYY,
keywords=housing unit estimates,
Description=%nrbquote(Estimates of total housing units by county for each year since &gbyear through &gyear),
DataSource=%str(U.S. Bureau of the Census),
keyvars=sumlev state county, keyfmats=sumlev state county,
SortedBy=state county,
SetGroup=us,
SubType=5other,
VarSet=,
URLMeta=, debug=0);
%doset(mode=,libname=popests,
memname=mohuest&gyear,geouniv=Missouri,units=%str(county state),
Years=%str(&gbyear-&gyear),CreatePgm=huestsYY,
keywords=housing unit estimates,
Description=%nrbquote(Mo subset of ushuest&gyear.: total housing units by county for each year since &gbyear through &gyear),
DataSource=%str(U.S. Bureau of the Census),
keyvars=sumlev state county, keyfmats=sumlev state county,
SortedBy=county,
SetGroup=mo,
SubType=5other,
VarSet=,
URLMeta=, debug=0);
%doset(mode=,libname=popests,
memname=uscomnst&gyr,
geouniv=UnitedStates,
units=nation state region,
Years=%str(2010-&Gyear),
CreatePgm=uscom201Ynst.cnvt,
Keywords=Population estimates state components of change migration births deaths time series post 2010,
Description=%nrbquote(Estimates of the total pop of the nation and states (and PR) for July 1 of each year from
2010 to &Gyear. along with annual birth, death, international and domestic migration estimates (the components of change).),
keyvars=SumLev state,
keyfmats=SumLev state,
DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released in December, &gyear.),
SortedBy=State County,
UsageNotes=%nrbquote(- Variables that do not have a time indicator are for July 1, &Gyear or for the
period 4-1-2010 to 7-1-&Gyear. So Popest is the latest estimate and Births is the estimated total births over the
poest-census period.
- Most variables have a base name and a time indictor suffix. The base names are Pop (total pop), PopC (population change),
BRTH , DTH (birth and death) , IMIG, DMIG, NMig (intermational, domestic and net
migration) and RSDL (residual). The time indicator suffix can be JLyy, where yy is a 2-digit year (the
1st 2 digits of the year are assumed to be 20), a single year span such as 1011 (the 1 year period from 7-1-2010 through
7-1-2011) or AJ10, indicating the quarterly period April through June, 2010.
- Note that natural increase + net migration= Pop Change. Domestic + International do not always add to net migration.
- The 2 variables with 1yr suffixes represent the change and pct change in the pop estimate over the most recent
1-year period.
- The rank variables are assigned based on the values of key variables, with lowest rank corresponding to highest values.
Thus if rankch1y=1 for a county it means that PopCh1yr for that county was the highest in the nation. If
rankpop=7 for a state it indicates that state had the 7th highest population estimate in the current year (~Gyear).
),
SubType=1com,
SetGroup=us,
URLmeta=%str(http://www.census.gov/popest/data/national/totals/&gyear./NST-EST&gyear.-alldata.html),
VarSet=,
debug=0);
proc sort data=popests.datasets out=bysortprio; by sortprio; run;
/*
proc datasets library=popests nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
*/
options mprint msglevel=i;
%gendshtm(libname=popests,debug=1,runprocc=1);
run;