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.
E.J. Cleveland, OSEDA, June, 2003
J. Blodgett, 8/05
IG, 3/06
-- */
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 *
****************************************************************************************;
%doset(mode=,libname=stf803x2,
memname=_template_msas80,
memlabel=%nrbquote(Metro Area Summaries for ~statenm),
geouniv=~statenm,
units=Metropolitan Statistical Areas,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for MSAs and CMSAs),
keyvars=sumlev state msacmsa,
keyfmats=sumlev state metro,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3),
SortedBy=,
UsageNotes=%nrbquote(),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
debug=0)
%doset(mode=,libname=stf803x2,
memname=_template_regns,
memlabel=%nrbquote(Various Regional (non-Census) Summaries for ~statenm),
geouniv=~statenm,
units=ded dot rpc umx,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for various state/university regions (ded,
rpc, umx, and dot)),
keyvars=sumlev rpc ded_region dot umx2,
keyfmats=sumlev rpcname dedrgn modot umxname,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
UsageNotes=%nrbquote(),
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_regns00,
memlabel=%nrbquote(Various Regional (non-Census) Summaries (as defined in 2000) for ~statenm),
geouniv=~statenm,
units=ded dot rpc umx,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for various state/university regions (ded,
rpc, umx, and dot). Changes were made to several geographies due to consolidation of some of the defined regions),
keyvars=sumlev rpc ded dot umx2,
keyfmats=sumlev rpcname dedrgn modot umxname,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county region,
UsageNotes=%nrbquote(),
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_cd108,
memlabel=%nrbquote(108th Congressional Districts Summaries for ~statenm),
geouniv=~statenm,
units=108th Congressional Districts,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for US Congressional Districts
of the 108th Congress as elected in 2002.),
keyvars=cd108,
keyfmats=,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3, with custom aggregation to new geography by MCDC.),
SortedBy=cd108,
UsageNotes=%nrbquote(
- Obviously, the time of the geography is not the same as the time of the data.
),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
debug=0)
%doset(mode=,libname=stf803x2,
memname=_template_house,
memlabel=%nrbquote(State House District Summaries for ~statenm),
geouniv=~statenm,
units=State House District,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for house legislative (620) summary level.),
keyvars=sumlev house,
keyfmats=sumlev,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county cousubfp,
UsageNotes=%nrbquote(),
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_senate,
memlabel=%nrbquote(State Senate Districts Summaries for ~statenm),
geouniv=~statenm,
units=State Senate Districts,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the 1980 standard demographic profile data for senat districts (610)
summary level as revised in 2002. ),
keyvars=sumlev geocode,
keyfmats=sumlev ,
keyquals=,
keyidvars=| areaname,
DataSource=%str(1980 Census, Summary Tape File 3.),
UsageNotes=%nrbquote(),
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_mcds90,
memlabel=%nrbquote(County Subdivisions Summaries for ~statenm),
geouniv=~statenm,
units=mcd,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for mcds (060) summary level.),
keyvars=sumlev county geocode,
keyfmats=sumlev county |,
keyquals=,
keyidvars=| | areaname,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=county cousubfp,
UsageNotes=%nrbquote(The variable geocode consists of the county fipco and cousubfp (county subdivision id)),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0)
%doset(mode=,libname=stf803x2,
memname=moschlcos00,
memlabel=%nrbquote(MO School District Within County Summaries),
geouniv=Missouri,
units=School District within County,
Year=1980,
CreatePgm=mocustomgeos,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the 1980 standard demographic profile data for school district-within-county
summary levels (se2 and su2) allocated to 2000 district boundaries.),
keyvars=sumlev county ncescode desedist partflag,
keyfmats=sumlev county,
keyquals=,
keyidvars= | | areaname areaname,
DataSource=%str(1980 Census, Summary Tape File 3.),
UsageNotes=%nrbquote(The geocode variable consists of the nces code and the five-digit fipco.),
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_schls00,
memlabel=%nrbquote(Complete School District Summaries for ~statenm),
geouniv=~statenm,
units=School Districts,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the 1980 standard demographic profile data for school districts (sde and sdu)
summary level allocated to 2000 district boundaries. ),
keyvars=sumlev ncescode desedist,
keyfmats=sumlev ,
keyquals=,
keyidvars= | areaname areaname,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county geocode,
UsageNotes=%nrbquote(The geocode variable consists of the nces code.),
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_stcnty,
memlabel=%nrbquote(State and County Summaries for ~statenm),
geouniv=~statenm,
units=State County,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for State (040) and County (050) summary levels.
),
keyvars=sumlev state fipco ,
keyfmats=sumlev state county,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=sumlev geocode,
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_places,
memlabel=%nrbquote(Place Summaries for ~statenm),
geouniv=~statenm,
units=Places,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for places (160) summary level.),
keyvars=state placefp,
keyfmats=state | ,
keyquals=,
keyidvars=| areaname,
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-90).),
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_zips90,
memlabel=%nrbquote(Zipcode Summaries for ~statenm),
geouniv=~statenm,
units=Zipcodes,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the standard demographic profile data for zipcodes (371) summary level as defined
by the U.S. Census Bureau. ),
keyvars=sumlev state,
keyfmats=sumlev state,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county geocode,
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 fall, 1991),
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_bgs00,
memlabel=%nrbquote(Block Group Summaries for ~statenm allocated to 2k geography),
geouniv=~statenm,
units=Block Groups,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the 1980 standard demographic profile data for 2000 block groups (approximated)
),
keyvars=sumlev county,
keyfmats=sumlev fipcnty,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county geocode,
UsageNotes=%nrbquote(The geocode variable consists of the two-digit state id number plus census tract
and block group.),
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_trs00,
memlabel=%nrbquote(Census Tract Summaries for ~statenm),
geouniv=~statenm,
units=Census Tract,
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Contains the 1980 standard demographic profile data for census tract (140) summary level as defined
by the U.S. Census Bureau for 2000 Geography.),
keyvars=sumlev county geocode,
keyfmats=sumlev fipcnty,
keyquals=,
keyidvars=,
DataSource=%str(1980 Census, Summary Tape File 3.),
SortedBy=state county geocode,
UsageNotes=%nrbquote(The geocode variable consists of the two-digit state id number plus the tract number.),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0)
*----Here we add the new set of XXzipcos90 datasets with zip within county summaries--------;
%doset(mode=,libname=stf803x2,
memname=_template_zipcos90,
memlabel=%nrbquote(1980 ZIP Code within County Summaries for ~statenm),
geouniv=~statenm,
units=%nrbquote(1980 ZIP/county),
Year=1980,
CreatePgm=moilkscnvts_stf803x2,
Keywords=stf3 standard extract ZIP code county demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Standard demographic profile data for ZIP-within-county (SumLev 881) for ~statenm),
keyvars=sumlev slvl state county zip,
keyfmats=| | state county,
DataSource=%str(1980 Census, Summary Tape File 3B.),
SortedBy=zip,
UsageNotes=%nrbquote(
- The ZIP codes on this file are vintage 1991 and are NOT current. Even if the same
code is still in use it does not necessarily correspond to the same geographic area.
- The slvl variable contains the code used on the original file, 820 while SumLev contains the 2000 near equivalent
value, 881. Strictly speaking 881 refers to ZCTAs, not ZIP codes, so they are different.
- The corresponding ~stab.zips90 dataset has summaries for complete ZIP codes and includes the primary county code,
i.e. the code for the county that the ZIP is in or mostly in.
- The geography-based variables are undefined on this dataset. No values for the land area, internal pt lat long coordinates
and persons per square mile.
),
SubType=,
SetGroup=~stab,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0)
%let state=29; %let stab=mo; %let statenm=Missouri;
%doset(libname=stf803x2,memname=mozipcos90,template=_template_zipcos90)
%doset(memname=&stab.regns,libname=stf803x2,template=_template_regns,debug=0);
%doset(memname=&stab.regns00,libname=stf803x2,template=_template_regns00,debug=0)
%doset(memname=&stab.stcnty,libname=stf803x2,template=_template_stcnty,debug=0)
%doset(memname=&stab.places,libname=stf803x2,template=_template_places,debug=0)
%doset(memname=&stab.zips90,libname=stf803x2,template=_template_zips90,debug=0)
%doset(memname=&stab.bgs00,libname=stf803x2,template=_template_bgs00,debug=0)
%doset(memname=&stab.trs00,libname=stf803x2,template=_template_trs00,debug=0)
%doset(memname=&stab.schls00,libname=stf803x2,template=_template_schls00,debug=0)
%doset(memname=&stab.mcds90,libname=stf803x2,template=_template_mcds90,debug=0)
%doset(memname=&stab.cd108,libname=stf803x2,template=_template_cd108,
CreatePgm=mocustomgeos,debug=0)
%doset(memname=&stab.house,libname=stf803x2,template=_template_house,
CreatePgm=mocustomgeos,
usagenotes=%nrbquote(These are the districts as redrawn by the state in 2001), debug=0)
%doset(memname=&stab.senate,libname=stf803x2,template=_template_senate,
CreatePgm=mocustomgeos,
usagenotes=%nrbquote(These are the districts as redrawn by the state in 2001), debug=0)
%let state=17; %let stab=il; %let statenm=Illinois;
%doset(libname=stf803x2,memname=ilzipcos90,template=_template_zipcos90,createpgm=moilkscnvts_stf803x2)
%doset(memname=&stab.stcnty,libname=stf803x2,template=_template_stcnty,debug=0)
%doset(memname=&stab.places,libname=stf803x2,template=_template_places,debug=0)
%doset(memname=&stab.mcds90,libname=stf803x2,template=_template_mcds90,debug=0)
%doset(memname=&stab.zips90,libname=stf803x2,template=_template_zips90,debug=0)
%let state=20; %let stab=ks; %let statenm=Kansas;
%doset(libname=stf803x2,memname=kszipcos90,template=_template_zipcos90,createpgm=moilkscnvts_stf803x2);
%doset(memname=&stab.stcnty,libname=stf803x2,template=_template_stcnty,debug=0)
%doset(memname=&stab.places,libname=stf803x2,template=_template_places,debug=0)
%doset(memname=&stab.mcds90,libname=stf803x2,template=_template_mcds90,debug=0)
%doset(memname=&stab.zips90,libname=stf803x2,template=_template_zips90,debug=0)
%let state=00; %let stab=us; %let statenm=United States;
%doset(libname=stf803x2,memname=uszipcos90,template=_template_zipcos90,createpgm=uscnvts_stf803x2)
%doset(memname=&stab.stcnty,libname=stf803x2,template=_template_stcnty,createpgm=uscnvts_stf803x2,debug=0)
%doset(memname=&stab.places,libname=stf803x2,template=_template_places,createpgm=uscnvts_stf803x2,
Description=%nrbquote(Standard demographic profile data for all places in US with population of 10,000+.),
keyvars=state placefp,
keyfmats=state | ,
keyquals=,
keyidvars=| areaname,
DataSource=%str(1980 Census, Summary Tape File 3C.),
debug=0)
%doset(memname=&stab.mcds90,libname=stf803x2,template=_template_mcds90,createpgm=uscnvts_stf803x2,debug=0)
%doset(memname=&stab.zips90,libname=stf803x2,template=_template_zips90,createpgm=uscnvts_stf803x2,debug=0)
%doset(memname=&stab.msas90,libname=stf803x2,template=_template_msas80,createpgm=uscnvts_stf803x2,debug=0)
%doset(memname=usregdiv,libname=stf803x2,template=,createpgm=uscnvts_stf803x2,
memlabel=%nrbquote(Various Regional (non-Census) Summaries for ~statenm),
geouniv=United States,units=US Region Division,
Year=1980,
Keywords=stf3 standard extract demographic indicators income education poverty 1980 census sample,
Description=%nrbquote(Std demographic profile data for the United States, its Regions and Divisions),
keyvars=sumlev region division,
keyfmats=sumlev ,
keyquals=,
keyidvars=| areaname areaname,
DataSource=%str(1980 Census, Summary Tape File 3.),
UsageNotes=%nrbquote(),
SubType=,
SetGroup=us,
VarSet=Variables,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803x2/Variables.pdf),
filters=,
debug=0)
%* First build the templates used lated to build records in Dataset dataset;
%* New Content starts here, starts with invoking doset for each state and the corresponding template;
%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);
run;
proc sort data=stf803x2.datasets out=bysortprio;
by SortPrio GeoUniv SetGroup SubType Memname ; run;
proc print data=bysortprio;
by libname notsorted libpath ;
id memname;
var SortPrio SetGroup SubType GeoUniv;
title2 'Listing of Selected Fields from stf803x2.datasets ';
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=0);