x cd /pub/data/stf803/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, Jan, 2005
-- */
title "Job to Invoke doset Macro for Sets in stf803, creating stf803.datasets";
libname stf803 '/pub/data/stf803';
%let libnameg=stf803;
*-----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=stf803,debug=1);
*----------------------------------------------------------------------;
%doset(mode=,libname=stf803,
memname=_template_iset,
memlabel=%nrstr(~statenm Inventory level summaries from File A),
geouniv=~statenm,
units=Inventory Summary Levels,
Year=1980,
CreatePgm=migrate_plus,
Keywords=1980 census ~statenm stf3,
Description=%nrbquote(~statenm summary tables for the state and all its counties, cities, and county subdivisions
from the 1980 decennial census.),
keyvars=SumLev State fipco smsa fipsplac,
keyfmats=sumlev state county smsa80_ fplace,
keyquals= | | | | state,
DataSource=%str(1980 Census - Summary Tape File 3A for ~statenm),
UsageNotes=%nrbquote(
- See the companion dataset stf803.~stab.h for "hierarchal" level summaries. Note that there are no summaries on this
dataset for census tracts, block groups or enumeration districts because the Bureau did not publish complete
("inventory") summaries for these levels on 1980 STF3 files. There are hierarchal versions of these on the ~stab.h
dataset.
- Missing values have been assigned to suppressed table cells using the supflgxx
variables (suppression flags). The flags themselves are stored as variables SUPFLG01 thru SUPFLG27 and have values of
either 1 (indicating the flag is set and the suppresion was applied) or missing to indicate no suppression.
- The naming convention used for table cells is T#I<n>
where # is the table number and <n> is the item (cell) number within the table.
- The 2-digit summary level codes used for the original files are stored in the variable SumryLvl and
we have assigned an equivalent value to the SumLev 3-digit code for consistency with current (2000) coding.
- Internal point latitude and longitude values as well as land area were extracted from the marf2 file for the state
and are only defined for certain summary levels.
- The combination of SumLev and Geocode should form a unique key for the dataset.
- The setup fix_marfdata.sas was run (2/06) to fix some problems with place and cd level summaries for vars such as
latitude, longitud and landarea. We created wtd avgs of lat/long at the complete place level. Landarea defined only for
places of 2500+ pop.
),
SubType=a,
SetGroup=~stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt),
debug=0);
/* =======================Begin comment================
%doset(mode=,libname=stf803,
memname=_template_hset,
memlabel=%nrstr(~statenm hierarchal level summaries from File A),
geouniv=~statenm,
units=Hierarchal Summary Levels,
Year=1980,
CreatePgm=migrate_plus,
Keywords=1980 census ~statenm stf3,
Description=%nrbquote(~statenm summary tables for the 4-level hierarchy of summaries (all within County Subdivision):
place, tract, block group and enumeration district),
keyvars=SumLev State fipco smsa fipsplac,
keyfmats=sumlev state county smsa80_ fplace,
keyquals= | | | | state,
DataSource=%str(1980 Census - Summary Tape File 3A for ~statenm),
UsageNotes=%nrbquote(
- See the companion dataset stf803.~stab.i for "inventory" level summaries. Note that there are no summaries on
either dataset for unsplit census tracts, block groups or EDs because the Bureau did not publish such
"inventory" summaries on 1980 STF3 files. The hierarchal versions (within place and/or county subdivision)
found on this dataset are all that are available.
- In 1980 and earlier censuses tracts and blocks were only assigned in urban areas, and EDs (enumeration districts) were
used in areas where there were no blocks (and hence no block groups). The hierarchy used here is really just 3-level with
the last level being either a bg or an ed depending on whether the area was blocked.
- Levels 15 and 16 actually include other codes that id the area summarized which is not stated in the tech doc.
These codes may include urbarea, indanv, congdist and even (in 1 case in MI, at least) ward. The
urbarurl variable indicates if the area is urban (01) or rural (08).
- Internal point lat/long. coordinate values and land area were extracted from the marf2 files for the states.
- Missing values have been assigned to suppressed table cells using the supflgxx
variables (suppression flags).
- The naming convention used for table cells is T#I<n>
where # is the table number and <n> is the item (cell) number within the table.
- The 2-digit summary level codes used for the original files are stored in the variable SumryLvl. We
have assigned equivalent values to the SumLev 3-digit code for consistency with current (2000) coding. Split EDs are
assigned a SumLev value of 16 (the same as the original 2-digit code) since that level is no longer used.
- The combination of SumLev and Geocode should form a unique key for the dataset.
),
SubType=a,
SetGroup=~stab,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt),
debug=0);
*---the cset template is for all the national ("File C") datasets---;
%doset(mode=,libname=stf803,
memname=_template_cset,
memlabel=,
geouniv=United States,
units=,
Year=1980,
CreatePgm=migrate_plus,
Keywords=1980 census stf3 national collection,
Description=,
DataSource=%str(1980 Census - Summary Tape File 3C),
UsageNotes=%nrbquote(
- Missing values have been assigned to suppressed table cells using the supflgxx
variables (suppression flags). The flags themselves are stored as variables SUPFLG01 thru SUPFLG27 and have values of
either 1 (indicating the flag is set and the suppresion was applied) or missing to indicate no suppression.
- The naming convention used for table cells is T#I<n>
where # is the table number and <n> is the item (cell) number within the table.
- The 2-digit summary level codes used for the original files are stored in the variable SumryLvl and
we have assigned an equivalent value to the SumLev 3-digit code for consistency with current (2000) coding.
- The combination of SumLev and Geocode should form a unique key for the dataset.
),
SubType=c,
SetGroup=us,
VarSet=variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt),
debug=0);
%doset(libname=stf803,memname=uscds96th,
template=_template_cset,
units=cds96,
description=Summaries for 96th Congressional Districts for entire US,
UsageNotes=%nrbquote(- The 96th congress was elected in 1978. These were the current CDs at the time of
the 1980 census
.),
keyvars=state,keyfmats=state,
debug=0) ;
%doset(libname=stf803,memname=usmcds11,description=Minor Civil Division summaries for 11 selected states,
template=_template_cset,units=MCD,
UsageNotes=%nrbquote(+- The 11 states are the 6 New England states, NY, PA, NJ, MI and WI
),
keyvars=state county, keyfmats=state county,
debug=0);
%doset(libname=stf803,memname=usmisc,
template=_template_cset,units=US Region Division SCSA SNSA UA,
description=%nrbquote(Summaries for US, Regions, Divisions, SCSAs, SMSAs and UAs, including within-state portions),
keyvars=sumlev state smsa , keyfmats=sumlev state smsa80_ ,
UsageNotes=%nrbquote(+),
debug=0);
%doset(libname=stf803,memname=usplaces,description=%str(Summaries for all places (cities) in the US, regardless of size
and including CDPs) ,
template=_template_cset,units=Places,
UsageNotes=%nrbquote(+- This is not the File C place data which had a pop threshold. Instead, this
dataset is just the concatenation of all the place level summaries from all 51 state datasets ("File A"). Complete places
only, no county parts.
),
keyvars=state fipsplac, keyfmats=state fplace,keyquals= | state,
DataSource=%str(1980 Census - Summary Tape File 3A State Files),
debug=0);
%doset(libname=stf803,memname=usstcnty,
template=_template_cset,units=State County,
description=%str(Summaries for States and Counties (and county equivalents) for the entire US) ,
UsageNotes=%nrbquote(+- While counties are a relatively stable unit of geography they can and do change over
time. Those changes are documented by the Census Bureau on their
web site.
),
keyvars=sumlev state county, keyfmats=sumlev state county,
debug=0);
%doset(libname=stf803,memname=uszips,
template=_template_cset, units=ZIP,
description=%str(Summaries for all 5-digit ZIP codes and ZIP-within-County/SMSA for the US) ,
keyvars=sumrylvl state county smsa pcounty split, keyfmats= | state county smsa80_ county,
UsageNotes=%nrbquote(- This was a special tab released as the "File B" series, one file per state
- There was no complete-count data for ZIPs so any items related to complete count values are
missing on this dataset.
- Where a ZIP code is contained entirely within 1 county/SMSA we have deleted the level 36 (split ZIP) summary.
- County and fipco are missing on the sumrylvl=35 (complete ZIP) summaries if the ZIP crosses a county or SMSA boundary.
- The variables pcounty and pfipco identify the primary county for the ZIP, meaning the county which contains
over half of the ZIP codes population (they will be blank if no county has a majority). Similarly, psmsa identifies the
primary SMSA.
- The split flag variable has a value of 1 to indicate a ZIP that is in more than 1 county/SMSA and a value of 0 to
indicate it is entirely contained in one such area. All of this is within the state. The split flag will not be set to
1 just because the ZIP crosses state lines.
- The ZIP codes used here are, of course, as defined at the time of the 1980 census and in high growth
areas may bear little resemblance to
current ZIP codes. Even if the code is still being used, there is a good chance it has changed its boundary since 1980.
- A handful of summaries from the original file had ZIP codes that were blank or all zeroes. These have been deleted.
),
DataSource=%str(1980 Census - Summary Tape File 3B (Via ICPSR Study 8071)),
Sortedby=State ZIP SumryLvl County SMSA,
debug=0);
======================End comment================== */
%macro doit(state,stab);
%doset(libname=stf803,memname=&stab.i,template=_template_iset) ;
%*doset(libname=stf803,memname=&stab.h,template=_template_hset) ;
%mend doit;
%dostates(n=51,names=1) ;
%*dostates(29,names=1) ;
*--------------------------------Post process to generate the final datasets.html page etc-----------------*;
proc sort data=stf803.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 stf803.datasets (Sorted by SortPrio)';
run ;
proc datasets library=stf803 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=stf803,debug=1,runprocc=1);
libname system '/pub/data/system';
%**metafix(filetype=stf803); *<---syncronize the Contents file descriptiosn with those in datasets.---;