x cd /pub/data/stf803x2/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
IG, 3/06, 3/15/2006
jgb 4-6-06.
jgb, adding usage note re dollar conversions 11-15.
-- */
title "Job to Invoke doset Macro for Sets in stf803x2, creating stf803x2.datasets";
libname stf803x2 '/pub/data/stf803x2';
*-----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=stf803x2,debug=0);
options source;
%*let todo=usplaces; *<======Set to actually process=================================;
****************************************************************************************
* Do standard sets for each state *
****************************************************************************************;
/*<=========================Comment out=====================================
%doset(mode=,libname=stf803x2,
memname=_template_mcds11,
memlabel=%nrbquote(MCD (Town/Township) Summaries for Selected States),
geouniv=Selected States,
units=mcd,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for MCDs in 11 Selected States),
keyvars=state county fipsmcd,
keyfmats=state county cousub ,
keyquals= | | county,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county fipsmcd,
UsageNotes=%nrbquote(Covers all of the New England and Mid Atlantic states plus MI and WI.),
SubType=,
SetGroup=us,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
%doset(mode=,libname=stf803x2,
memname=_template_misc,
memlabel=%nrbquote(Miscellaneous Summaries for US),
geouniv=UnitedStates,
units=,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for miscellaneous US summary levels.),
keyvars=sumlev state,
keyfmats=sumlev state,
keyquals=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=,
UsageNotes=,
SubType=,
SetGroup=us,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
%doset(mode=,libname=stf803x2,
memname=_template_places,
memlabel=%nrbquote(Place Summaries for ~statenm),
geouniv=UnitedStates,
units=Places,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for places (160) summary level.),
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state geocode,
UsageNotes=%nrbquote(These are the places as defined at the time of the 1980 census (1-1-80).),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
%doset(mode=,libname=stf803x2,
memname=_template_zips,
memlabel=%nrbquote(Zipcode Summaries for ~statenm),
geouniv=~statenm,
units=Zipcodes,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for ZIP codes),
keyvars=sumlev state county,
keyfmats=sumlev state county,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3B.),
SortedBy=state,
UsageNotes=%nrbquote(
- The geocode variable consists of the two-digit state id number plus the 5-digit ZIP code.
- These ZIP codes are approximate and are vintage 1981),
SubType=,
SetGroup=us,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0)
===========================End commented out================================ */
%doset(mode=,libname=stf803x2,
memname=_template_h,
memlabel=%nrbquote(Hierarchal level summaries for ~statenm),
geouniv=~statenm,
units=%str(ed mcd/place mcd/place/tract mcd/place/tract/bg),
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for hierarchal levels),
UsageNotes=%nrbquote(
- All summaries are within (i.e. split by) county - county subdivision - place
- We added the 2000-vintage SumLev codes, but also kept the original 2-digit codes in variable SumryLvl.
- Remember that in 1980 tracts and blocks (thus block groups) were only defined in urban areas. So you will not find
any 082 or 090 summaries in non-metro counties.
- Enumeration districts (SumLev=16) are defined whereever block groups are not. EDs have 5-char codes with 4 digits and sometimes an
alpha suffix. They nest within townships (mcds) and places. So while they fit in the hierarchal dataset they can
also be viewed as inventory summaries.
- Note that the geocode for SumLev 16 (EDs) is just the county code and the ED code.
- There was data suppression in 1980 so you will encounter missing values at times, especially for small areas. This
makes aggregation problematic.
- All dollar income values (such as MedianHHInc) have been multiplied by 1.708 to convert from 1979 to 1989 dollars. Housing value
variables (such as avghval) have been multiplied by 1.586 to convert from 1980 to 1990 dollars.
),
keyvars=sumlev county fipsmcd fipsplac smsa,
keyfmats=sumlev county cousub fplace smsa,
keyquals= | | county state,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=fipco mcd place,
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
%doset(mode=,libname=stf803x2,
memname=_template_i,
memlabel=%nrbquote(Inventory Summaries for ~statenm),
geouniv=~statenm,
units=State County mcd place cd,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for inventory summary levels for ~statenm),
UsageNotes=%nrbquote(- Usually when we think of inventory summary levels we think of complete census tracts and
block groups (for example) - but such summaries were incredibly not included by the Bureau on the the STF3 datasets.
- The congressional districts are as defined on 1-1-80 (96th)
- All dollar income values (such as MedianHHInc) have been multiplied by 1.708 to convert from 1979 to 1989 dollars. Housing value
variables (such as avghval) have been multiplied by 1.586 to convert from 1980 to 1990 dollars.
),
keyvars=sumlev county fipsmcd fipsplac smsa,
keyfmats=sumlev county cousub fplace smsa,
keyquals= | | county state,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=county sumlev,
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
/*<=========================Comment out=====================================
* New Content starts here, starts with invoking doset for each state and the corresponding template ;
%let statenm=United States;
%let stab=us; %let state=00;
%doset(memname=&stab.mcds11,libname=stf803x2,template=_template_mcds11,debug=0) ;
%doset(memname=&stab.misc,libname=stf803x2,template=_template_misc,debug=0) ;
%doset(memname=&stab.places,libname=stf803x2,template=_template_places,debug=0) ;
%doset(memname=&stab.zips, libname=stf803x2,template=_template_zips,debug=0)
===========================End commented out================================ */
*---We noticed that we had failed to convert the usstcnty dataset. So we added it and we do the entry without use of
a template.---;
%doset(mode=,libname=stf803x2,
memname=usstcnty,
memlabel=%nrbquote(State and County Summaries for United States),
geouniv=UnitedStates,
units=State County,
Year=1980,
CreatePgm=cnvtallstates_stf803x2,
Description=%nrbquote(Standard demographic profile data for state and county summary levels.),
keyvars=sumlev county state,
keyfmats=sumlev county state ,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=,
UsageNotes=%nrbquote(- Includes summaries for county equivalents such as independent cities and parishes in LA
- All dollar income values (such as MedianHHInc) have been multiplied by 1.708 to convert from 1979 to 1989 dollars. Housing value
variables (such as avghval) hav been multiplied by 1.586 to convert from 1980 to 1990 dollars.
),
SubType=,
SetGroup=us,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0);
%macro doit(state,stab);
%doset(libname=stf803x2,memname=&stab.i,template=_template_i);
%doset(libname=stf803x2,memname=&stab.h,template=_template_h);
%mend doit;
%dostates(names=1,n=51);
/* =======================Begin comment================
%let stab=mo; %let statenm=Missouri; %let state=29;
%doset(libname=stf803x2,memname=&stab.i,template=_template_i);
%doset(libname=stf803x2,memname=&stab.h,template=_template_h);
%* --End section for debugging --;
======================End comment================== */
run;
proc datasets library=stf803x2 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint;
%gendshtm(libname=stf803x2,debug=0,runprocc=1);