x cd /pub/data/sf32000/Tools; %let pgm=invoke_dosets_slds2007; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this sub-directory.
J. Blodgett, OSEDA, May., 2009 (this is the "do-over" version created after we lost our data and had
to restore and/or reconvert it, spring, 2009.
-- */
title "Job to Invoke doset Macro for Sets in sf32000/slds2007, recreating sf32000.datasets";
%let libnameg=slds2007;
libname sf32000 '/pub/data/sf32000';
libname slds2007 '/pub/data/sf32000/slds2007';
*-----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=slds2007,debug=0);
*----------------------------------------------------------------------;
%macro doit(state,stab);
%doset(mode=,filetype=sf32000,
memname=&stab.sldph,
geouniv=&statenm,
units=State Leg Dists 2002,
Year=2000,
CreatePgm=cnvtsf3_slds,
Description=%nrbquote(P & H tables for the 2002 state legislative districts),
keyvars=SumLev county sldu sldl,
keyfmats=sumlev county ,
DataSource=%str(2000 Census, Summary File 3 (special tab rel. 2007)),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(
- We did not convert the data for all the geographic areas represented on this data set. We
kept only summaries for the state, complete districts and districts within counties.
- These districts were created in 2001-2002 and were in effect for state legislatures elected in 2002.
),
SubType=ph,
SetGroup=&stab,
VarSet=variablesph,
URLMeta=%str(http://www.census.gov/Press-Release/www/2007/sld_sumfiles.html),
debug=0)
%doset(mode=,filetype=sf32000,
memname=&stab.sldphct,
geouniv=&statenm,
units=State Leg Dists 2002,
Year=2000,
CreatePgm=cnvtsf3_slds,
Description=%nrbquote(PCT & HCT tables for the 2002 state legislative districts),
keyvars=SumLev county sldu sldl,
keyfmats=sumlev county ,
DataSource=%str(2000 Census, Summary File 3 (special tab rel. 2007)),
SortedBy=LogRecNo,
UsageNotes=%nrbquote(- We only converted summaries
for the state, complete districts and districts within counties. Further detail by MCD and city (within SLD) are available from the
Bureau but not here.
- These districts were the result of redistricting done in 2001-2002 and were in effect for state legislatures elected in 2002.
),
SubType=phct,
SetGroup=&stab,
VarSet=variablesphct,
URLMeta=%str(http://www.census.gov/Press-Release/www/2007/sld_sumfiles.html),
debug=0)
%mend doit;
%dostates(n=52,names=1)
proc sort data=slds2007.datasets out=bysortprio;
by SortPrio GeoUniv SetGroup SubType Memname ; run;
proc datasets library=slds2007 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=slds2007,debug=0,runprocc=1);
%include sascode(notify);