x cd /pub/data/acs2009/Tools; %let pgm=invoke_dosets_profiles; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for the acs2009 directory which contains key profiles
data sets as well as geography sets. Does not include basetbls data which is handled separately.
J. Blodgett, OSEDA, Oct, 2010
Adding the tract level allocated data sets using 2010 tracts 3/2016. (See /pub/tutorials/data_allocation).
-- */
title "Job to Invoke doset Macro for Sets in acs2009";
libname acs2009 '/pub/data/acs2009';
libname user '/SAS_temp/user';
%let libnameg=acs2009;
%let gyear=2009;
%*let todo=_template_mcdcpros5 momcdcprofiles5yr;
%*let todo=usmcdcprofiles5yr allgeos allgeos5yr _template_allgeos;
%*let todo=momcdcprofiles5yr;
%let todo=;
*-----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=acs2009,debug=1);
*----------------------------------------------------------------------;
/*<=========================Comment out=====================================
options mprint;
%doset(memname=_template_mcdcpros1,
filetype=acs2009,
geouniv=United States,
memlabel=%str(MCDC profile extract for all US areas with 65,000+ population based on ~gyear surveys),
Description=%nrbquote(MCDC-defined profile extracts for Areas of 65,000+ population as used in acsprofiles web app),
units=%nrbquote(Nation State County PUMA etc),
Year=&gyear,
CreatePgm=upload_edit_usmcdcprofiles,
keyvars=sumlev geocomp state county cbsa ua placefp metrodiv csa necta,
keyfmats=sumlev geocomp state county cbsa uauc2k fplace metrodiv csa necta,
keyquals= %str( | | | | | | state | | |),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=State LogRecno,
UsageNotes=%nrbquote(
- These are 1-year estimates based on ACS data collected in ~gyear .
- This dataset was created on a different system and copied to the archive.
- Look for corresponding data set with "3yr" or "5yr" suffix to get similar data for multi-year periods.
- Variables are about 90 pct based directly upon items in Census Bureau profile tables. But some we derived from reading the base
tables. See Variables.pdf file in this directory for summary report.
- Specify a filter of State Equal To 29 to select Missouri summaries only. Change 29 to 06 to select California data, etc.
- Expect some missing values due to the Bureau policy not to release tables deemed statistically unreliable.
- MOE (Margin of [sampling] Error) data are stored here along with the estimates. They all have names of form <estname>_moe
- Standard geographic header info from Bureau geo txt files included.
),
SubType=1yrpro,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/data/acs2009/Variables.pdf)
);
%doset(libname=acs2009,memname=usmcdcprofiles,template=_template_mcdcpros1,
UsageNotes=%nrbquote(+ Data set may be rerun to change some names of poverty variables and add CBSA codes to county summaries ),
debug=0) ;
%doset(memname=_template_mcdcpros3,
filetype=acs2009,
geouniv=United States,
memlabel=%str(MCDC profile extract for all US areas with 20,000+ population based on ~gyear surveys),
Description=%nrbquote(MCDC-defined profile extracts for Areas of 20,000+ population as used in acsprofiles web app),
units=%nrbquote(Nation State County PUMA etc),
Year=&gyear,
CreatePgm=cnvt_census_to_mcdc,
keyvars=sumlev geocomp state county cbsa ua placefp metrodiv csa necta,
keyfmats=sumlev geocomp state county cbsa uauc2k fplace metrodiv csa necta,
keyquals= %str( | | | | | | state | | |),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=State LogRecno,
UsageNotes=%nrbquote(- These are 3-year period estimates based on ACS data collected in ~gyear .
- Variables are about 90 pct based directly upon items in Census Bureau profile tables. But some we derived from reading the base
tables. See Variables.pdf file in this directory for summary report.
- Specify a filter of State Equal To 29 to select Missouri summaries only. Change 29 to 06 to select California data, etc.
- Expect some missing values due to the Bureau policy not to release tables deemed statistically unreliable.
- MOE (Margin of [sampling] Error) data are stored here along with the estimates. They all have names of form <estname>_moe
- Standard geographic header info from Bureau geo txt files included.
),
SubType=3yrpro,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/data/acs2009/Variables.pdf)
);
%doset(memname=_template_mcdcpros5,
filetype=acs2009,
geouniv=United States,
memlabel=%str(MCDC profile extract for almost all geo units (no min pop req) based on ~gyear surveys),
Description=%nrbquote(MCDC-defined profile extracts for all Areas as used in acsprofiles web app),
units=%nrbquote(Nation State County PUMA place tract MCD etc),
Year=&gyear,
CreatePgm=usmcdcprofiles5yr,
keyvars=sumlev geocomp state county cbsa ua placefp metrodiv csa necta,
keyfmats=sumlev geocomp state county cbsa uauc2k fplace metrodiv csa necta,
keyquals= %str( | | | | | | state | | |),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=State LogRecno,
UsageNotes=%nrbquote(- These are 5-year period estimates based on ACS data collected in ~gyear .
- Variables are about 90 pct based directly upon items in Census Bureau profile tables. But some we derived from reading the base
tables. See Variables.pdf file in this directory for summary report.
- Unlike the 1 and 3-year data sets you should not encounter any missing data in these tables.
- MOE (Margin of [sampling] Error) data are stored here along with the estimates. They all have names of form <estname>_moe
- The poverty data in these data sets differs from the 1 and 3-year sets due to the withholding of table B17002.
- Standard geographic header info from Bureau geo txt files included.
),
SubType=5yrpro,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/data/acs2009/Variables.pdf)
);
%let gyear=%str(2005-2009);
%doset(libname=acs2009,memname=momcdcprofiles5yr,template=_template_mcdcpros5,
memlabel=%str(Missouri-only 5-year data),
geouniv=Missouri,setgroup=mo,units=county puma place cbsa school township etc,
UsageNotes=%nrbquote(+ This is our first-ever 5yr data set. Please report any suspicious of missing data you find. Use with
caution.
There is (or will be shortly) a corresponding us data set with data for the entire country.
),
debug=0) ;
%let gyear=%str(2005-2009);
%doset(libname=acs2009,memname=usmcdcprofiles5yr,template=_template_mcdcpros5,
memlabel=%str(5-year data for the entire US),
geouniv=United States,setgroup=us,units=%str(Many, from nation to census tract),
UsageNotes=%nrbquote(+ This is our first-ever 5yr data set. Please report any suspicious of missing data you find. Use with
caution.
There is a corresponding us data set with data for Missouri only.
We ask that you download one state or just a few summary levels at a time, to avoid system overload.
),
debug=0) ;
%let gyear=%str(2007-2009);
%doset(libname=acs2009,memname=usmcdcprofiles3yr,template=_template_mcdcpros3,
UsageNotes=%nrbquote(+ Data set may be rerun to change some names of poverty variables and add CBSA codes to county summaries ),
debug=0) ;
%doset(memname=_template_allgeos,
filetype=acs2009,
geouniv=United States,
Description= %str(Geographic headers data for all geo units based on ~gyear surveys),
units=%nrbquote(many and varying),
Year=&gyear,
CreatePgm=,
keyvars=sumlev geocomp state county cbsa ua placefp metrodiv csa necta,
keyfmats=sumlev geocomp state county cbsa uauc2k fplace metrodiv csa necta,
keyquals= %str( | | | | | | state | | |),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=Sumlev Geocomp State Geocode,
UsageNotes=%nrbquote(- While based on the geography headers file provided as part of the ACS data this data set has been
signficantly enhanced.
- Whenever County is defined the related variables cbsa, cbsatype, csa, metdiv and necta are also filled in based on County.
- Geoid=Sumlev||Geocomp||"US"||Geocode .
- UR takes on values U and R when geocomp takes on values of 01 and 43, respectively. Otherwise it is blank.
- We keep separate allgeos data sets (5yr only) for levels 080 (tract within place and MCD) and 150 (block group) .
),
SubType=5yrpro,
SetGroup=geos,
VarSet=,
URLMeta=%str(http://www.census.gov/acs/www/data_documentation/geography/)
);
%doset(memname=allgeos,template=_template_allgeos)
%doset(memname=allgeos5yr,template=_template_allgeos)
===========================End commented out================================ */
%macro doit(state,stab);
%doset(memname=&stab.tracts10,
filetype=acs2009,
geouniv=&statenm,units=2010 tracts,
Description=%nrbquote(MCDC-defined profile extracts aggregated to 2010 tracts),
Year=%str(2005-2009),
CreatePgm=allocate2trk2010,
keyvars=year vintage sumlev county,
keyfmats=| | sumlev county,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=State county tract,
UsageNotes=%nrbquote(- The 5-year period estimates for 2005-2009 at tract level in usmcdcprofiles5yr used 2000 tracts.
- Using an equivalency file based on the Bureau blkrel10 data we allocated the data to get it in 2010 tracts.
- States Alabama Alaska Colorado Iowa Maryland Massachusetts Michigan Minnesota Texas and Virginia had problems matching geography
- MOE (Margin of [sampling] Error) data are not available on these data sets.
- The only geographic codes stored are state county and tract. Also esriid and Areaname.
- See the tutorial module regarding data allocation using geographic equivalency files including detailed analysis of how we
created these data sets at mcdc.missouri.edu/tutorials/data_allocation .
),
SubType=5yrpro2010tr,
SetGroup=&stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/data/acs2009/Variables.pdf)
);
%mend doit;
%dostates(n=51);
proc sort data=acs2009.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 acs2009.datasets (Sorted by SortPrio)';
run cancel;
proc datasets library=acs2009 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=acs2009,debug=1,runprocc=0);