x cd /pub/data/acs2011/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, Sep. 2012
Jan. /Feb. 2013
March 9, 2013: Rerunning with deleted data sets deleted and with special step to reassing sortprio to get more
logical ordering of Datasets.
Rerun 10-31-13 after we replace the "2" suffix sets with alt suffix, i.e. usmcdcprofiles5yralt.
-- */
title "Job to Invoke doset Macro for Sets in acs2011, creating acs2011.datasets";
%*et todolist=ussldu12s5yr ussldl12s5yr ;
%*let todolist=usmcdcprofiles3yr usmcdcprofiles5yr;
%let todolist=usmcdcprofiles5yralt;
%let libnameG=acs2011;
libname acs2011 '/pub/data/acs2011';
/*<=========================Comment out=====================================
*-----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=acs2011,debug=1);
===========================End commented out================================ */
*----------------------------------------------------------------------;
%doset(
memname=usmcdcprofiles ,memlabel=%str(Single year 2011 summaries for all areas with pop of at least 65000),
libname =acs2011,urlmeta=%str(/pub/data/acs2011/Variables.pdf),
units=us state county place puma cd etc,
years=2011,
universe=United States,
sortprio=1,
keyvars=sumlev state county placefp,
keyfmats=sumlev state county place,
keyquals= | | | state,
Description = %nrbquote(Data for all large US geographies, 2011 1-year Period Estimates),
UsageNotes=%nrbquote(
- "Large" means a minimum of 65,000 population in 2011.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
- This dataset was regenerated Oct 10, 2011 after a thorough review of the previous version created 9-26-11. We had to write all
new code this cycle due to changes in the input formats available to us. We are also now having to use formulae to estimate many MOE
values rather than reading the values published by the Bureau.
),
debug=0);
%doset(
memname=usmcdcprofiles3yr,memlabel=%str(2009-2011 3-year summaries for all areas with pop of at least 20000),
libname =acs2011,urlmeta=%str(/pub/data/acs2011/Variables3yr.pdf),
units=us state county place puma cd etc,
years=%str(2009-2011),
universe=United States,
sortprio=1,
keyvars=sumlev state county placefp,
keyfmats=sumlev state county place,
keyquals= | | | state,
Description = %nrbquote(Data for all large and medium US geographies, 2009-2011 3-year Period Estimates),
UsageNotes=%nrbquote(- "Large" means a minimum of 65,000 and "medium" 20,000 population in 2011.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usmcdcprofiles5yr,memlabel=%str(2007-2011 5-year summaries for all areas),
libname =acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
units=us state county place puma cd tract etc,
years=%str(2007-2011),
universe=United States,
sortprio=1,
keyvars=sumlev state county placefp geocomp,
keyfmats=sumlev state county place geocomp,
keyquals= | | | state,
Description = %nrbquote(Data for all US geographies, regardless of pop size, 5-year Period Estimates),
UsageNotes=%nrbquote(
- Census geography (census tracts and county subdivisions) are 2010.
- Geographic ID variables on this dataset are not complete. See 5yr us geography-specific sets for complete geocodes.
- A state variable value has been assigned for the Sumlev=860 observations, being the primary state for the ZCTA.
- includes data at tract and block group levels. Fewer variables defined at BG level.
- Contains both estimates and MOE (margin of error) values, intermixed.
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usmcdcprofiles5yr2,
Memlabel = %nrbquote(Same as usmcdcprofiles5yr but with all MOE variables moved to the end of the observations),
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
units=us state county place puma cd tract etc,
years=%str(2007-2011),
universe=United States,
sortprio=1,
keyvars=sumlev state county placefp geocomp,
keyfmats=sumlev state county place geocomp,
keyquals= | | | state,
Description = %nrbquote(Alternate version of usmcdcprofiles5yr but with all MOE variables moved to the end of the observations),
UsageNotes=%nrbquote(
- This data set no longer used. See usmcdcprofiles5yralt instead.
- Census geography (census tracts and county subdivisions) are 2010.
- Geographic ID variables on this dataset are not complete. See 5yr us geography-specific sets for complete geocodes.
- A state variable value has been assigned for the Sumlev=860 observations, being the primary state for the ZCTA.
- There is no block group level data here.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usgeocomps5yr,memlabel=%str(Period Estimates (2007-2011 5-year) for all US Geographic Components),
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=str(us state region division etc/geocomp),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state geocomp,
keyfmats=sumlev state geocomp,
keyquals=%str( | | | ) ,
Description = %nrbquote(Data for all US geographic components, such as urban and rural portions, 5-year Period Estimates),
UsageNotes=%nrbquote(- This is a subset of the usmcdcprofiles5yr2 data set,
- Urban and Rural summaries use the 2000-census-based definitions.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usregdiv5yr,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=str(us region division),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev ,
keyfmats=sumlev,
Description = %nrbquote(Data for US (nation totals), Regions, and Division),
UsageNotes=%nrbquote(- This is a subset of the usmcdcprofiles5yr2 data set,
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usstcnty5yr,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
units=State County,
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state county cbsa,
keyfmats=sumlev state county cbsa,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US States Counties and Equivalents),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data
- From the SF1 dataset we added pop counts from 2000 and 2010 censuses,
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usplaces5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(place and place/county),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state county placefp,
keyfmats=sumlev state county place,
keyquals=%str(| | | state),
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US Cities),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- Has both summary levels 160 and 155. The latter is place-within-county. No SF1 data for the 155 summaries.
- County variable is blank on 160 level summaries.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=uscousubs5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(mcds (county subdivisions)),
years=%str(2007-2011),
universe=United States,
keyvars=state county lsadc,
keyfmats=state county lsadc,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US County Subdivisions),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- County subs go by various names in different states. Called Towns in New England and mid-Atlantic states, Townships in Missouri.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=uscdslds5yr,memlabel=%str(111th CD and 2009 state leg district data),
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(cd sldu sldl),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state county ,
keyfmats=sumlev state county,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US Congressional and State Legislative Districts),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- CDs are 111th Congress (2009) and SLDs are as of 2009, prior to post-census redistricting.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usschools5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(School District),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state,
keyfmats=sumlev state,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US School Districts),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- There are 3 kinds of districts: elementary, secondary and unified. The types vary by state.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=uspumas5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(2010 PUMAs),
years=%str(2007-2011),
universe=United States,
keyvars=state,
keyfmats=state,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US Public Use Microdata Areas),
UsageNotes=%nrbquote(
- These are the 2000 PUMAs. The 2010 PUMAs were not ready in time to be used this cycle.
These are the same codes currently being used on the ACS PUMS files.
- There is no SF1 data on this dataset.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usurbareas5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(2002 Urban Areas),
years=%str(2007-2011),
universe=United States,
keyvars=,
keyfmats=,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US Urban Clusters and Urbanized Areas),
UsageNotes=%nrbquote(- No SF1 data on this data set.
- These are complete areas. There are no within-state summaries and state codes are not defined.
- These are the UAs defined circa 2002 based on pop densities found in the 2k census. 2010 UAs have not yet been assigned.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
%doset(
memname=usmetros5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(2010 Metro Areas),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev cbsa csa metdiv state,
keyfmats=sumlev cbsa csa metrodiv state,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US CBSAs, CSAs, Metro Divs and New England Metro Areas),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- Contains complete and within-state summaries.
- CBSA is blanket term for Metropolitan and Micropolitan Statistical Areas.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
),
debug=0);
%doset(
memname=uszctas5yr,memlabel=,
CreatePgm=mcdcprofiles5yr,
units=%str(ZCTAs),
years=%str(2007-2011),
universe=United States,
keyvars=state,
keyfmats=state,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US ZCTAs,),
UsageNotes=%nrbquote(- Dataset has been enhanced by merging it with selected items from the MCDC
sf1x.uszctas860 dataset, which in turn was created by aggregation of 861-level sf1x summaries and then merging
seleted geographic info from the georef.zcta_master dataset.
- Contains level 860 summaries: complete ZCTA. But we have added geocodes indicating primary state and county.
- This dataset is very different from the 2006-2010 version which we aggregated ourselves from tract level data and
which contain no moe values.
),
debug=0);
run;
%doset(
memname=usamindianetc5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(American Indian Resevations etc),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state,
keyfmats=sumlev state,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US American Indian Reservations and Similar Areas),
UsageNotes=%nrbquote(
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
),
debug=0);
%doset(
memname=ustracts5yr,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=mcdcprofiles5yr,
units=%str(2010 census tract),
years=%str(2007-2011),
universe=United States,
keyvars=sumlev state county cbsa,
keyfmats=sumlev state county cbsa,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US Census Tracts),
UsageNotes=%nrbquote(- Created by merging usmcdcprofiles5yr2 with 2010 SF1 data.
- These are the 2010 tracts. They do no match the 2000 census tracts used on the 2005-2009 data from last year.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
- Some tracts in Madison and Oneida counties, NY are new "2011" tracts and will not match with sf1 data.
),
debug=0);
%doset(
memname=usbgs5yrtemp,memlabel=,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
CreatePgm=tempusbgs,
units=%str(2010 Block Groups),
years=%str(2007-2011),
universe=United States,
keyvars=state county,
keyfmats=state county,
Description = %nrbquote(Period Estimates (2007-2011 5-year) for all US block groups),
UsageNotes=%nrbquote(
- This is labeled as a temporary version because we plan to regenerate it with some of the variables filled in
that are now always missing. We can do this by modifying the code we use to define these variables so they reference
summary tables that are not always missing for the BG level. Even after doing that there will be significantly less
data available for BGs than for any other geographic unit available from the ACS.
- These are complete block groups (summary level 150)
- Extreme caution should be excercised when looking at these data for any specific BG. The MOE values tend to be very
large, making the data of little or no value for evaluating the BG. These data are more intended for applications that
require aggregating data locally defined geographies or for circular area estimating.
- Key variables from the 2010 census (SF1) have been added so you can compare them with the ACS estimates. These variables
all have names with "sf1" suffixes.
- Some BGs in Madison and Oneida counties, NY are new "2011" BGs and will not match with sf1 data.
- Contains both estimates and MOE (margin of error) values
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
),
debug=0);
%doset(
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
memname=uscd113s5yr,memlabel=%bquote(MCDC estimated 113th CD data allocated from tract estimates),
CreatePgm=uscd113slds_allocation,
units=%str(113th CDs),
years=%str(2007-2011),
universe=United States,
keyvars=state,
keyfmats=state,
sortedby=state,
Description = %nrbquote(Unofficial allocated estimates of 113th CDs),
UsageNotes=%nrbquote(- We used a 2010 census tract to CD113 equivalency file, matched with data in ustracts5yr
to create these unofficial estimates.
- We dealt with problems caused by some ACS tracts being new and not matching the 2010 versions in 2 NY state counties
- There are no MOE (margin of error) data on this set.
- Official data for these CDs will not be released by the Bureau until the 2012 vintage release.
),
debug=0);
run;
%doset(
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
memname=ussldl12s5yr,memlabel=%bquote(MCDC estimated 2012 state leg district allocated from tract estimates),sortprio=3,
CreatePgm=uscd113slds_allocation,
units=%str(2012 SLDs lower chamber/House),
years=%str(2007-2011),
universe=United States,
keyvars=state,
keyfmats=state,
sortedby=state,
Description = %nrbquote(Unofficial allocated estimates of 2012 state House (lower chamber) districts),
UsageNotes=%nrbquote(- We used a 2010 census tract to 2012 SLD equivalency file, matched with data in ustracts5yr
to create these unofficial estimates.
- We dealt with problems caused by some ACS tracts being new and not matching the 2010 versions in 2 NY state counties
- There are no MOE (margin of error) data on this set.
- Official data for these SLDLs will not be released by the Bureau until the 2012 vintage release.
- Nebraska and DC have no lower chambers so are not represented on this dataset.
),
debug=0);
run;
%doset(
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
memname=ussldu12s5yr,memlabel=%bquote(MCDC estimated 2012 state leg district allocated from tract estimates),sortprio=3,
CreatePgm=uscd113slds_allocation,
units=%str(2012 SLDs upper chamber/Senate),
years=%str(2007-2011),
universe=United States,
keyvars=state,
keyfmats=state,
sortedby=state,
Description = %nrbquote(Unofficial allocated estimates of 2012 state Senate (higher chamber) districts),
UsageNotes=%nrbquote(- We used a 2010 census tract to 2012 SLD equivalency file, matched with data in ustracts5yr
to create these unofficial estimates.
- We dealt with problems caused by some ACS tracts being new and not matching the 2010 versions in 2 NY state counties
- There are no MOE (margin of error) data on this set.
- Official data for these SLDUs will not be released by the Bureau until the 2012 vintage release.
),
debug=0);
run;
*-----------------------Now do the Missouri subset views-----------------------------*;
%Macro moview(setname);
%doset(memname=mo&setname.5yr,template=us&setname.5yr,universe=Missouri,memlabel=Mo Subset of us&setname.5yr,
description=Missouri subset of us&setname.5yr,sortprio=4)
;
%mend moview;
/* ========================begin comment====================================
%moview(cdslds)
%moview(cousubs)
%moview(places)
%moview(pumas)
%moview(schools)
%moview(stcnty)
%moview(tracts)
%moview(zctas)
%moview(cd113s)
%moview(sldl12s)
%moview(sldu12s)
*----Custom data step to modify the sortprio values--------*;
data acs2011.datasets; set acs2011.datasets_old;
if memname=:'usmcdcprofiles' then sortprio=1;
else if memname=:'us' and substr(memname,length(memname)-2,3)='5yr' then sortprio=3;
else if memname='usbgs5yrtemp' then sortprio=4;
else if memname=:'mo' then sortprio=5; else if memname=:'allgeos' then sortprio=6;
else if units ne ' ' then sortprio=7;
else sortprio=9;
run;
==========================end comment====================================== */
%doset(
memname=usmcdcprofiles5yralt,
Memlabel =%nrbquote(Similar to usmcdcprofiles5yr but no tracts or BGs, with all MOE variables moved to the end of the observations),
Createpgm=mcdcprofiles5yralt,
libname=acs2011,urlmeta=%str(/pub/data/acs2011/Variables5yr.pdf),
units=us state county mcd place puma cd ZCTA etc,
years=%str(2007-2011),
universe=United States,
sortprio=1,
keyvars=sumlev state county placefp geocomp cbsa,
keyfmats=sumlev state county place geocomp cbsa,
keyquals= | | | state,
Description = %nrbquote(Alternate version of usmcdcprofiles5yr but with all MOE variables moved to the end of the observations),
UsageNotes=%nrbquote(
- This data was created late in the cycle and replaces the old 5yr2 set. Excludes sumlevs 080, 140 and 150.
- Geographic ID variables on this dataset are not complete. See 5yr us geography-specific sets for more complete geocodes.
- A state variable value has been assigned for the Sumlev=860 observations, being the primary state for the ZCTA.
- There is no block group or tract level data here. Those data are in separate data sets.
- Margin of error variable names are the same as the estimate names but with "_moe" appended.
- The variables included in this data set are very similar to those included in the Census Bureau dp01 thru dp04 profiles.
They are identical to the variables that appear in the MCDCs ACS Profile reports.
),
debug=0);
proc sort data=acs2011.datasets out=bysortprio; by sortprio ; *run;
proc datasets library=acs2011 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=acs2011,debug=1,runprocc=1);