x cd /pub/data/pl942000/Tools; %let pgm=basic_trend_report; filename pgm "&pgm..sas"; /* ----This report generates the pl94-based "Basic Trend Report". This setup may or may not use a 1990 pl94-based data set to make it a true trend report. But will work perfectly well without a 90 data set as well. Regenerating most of the reports after enhancements to the pl94trnd macro, 4-21-01. Formatting enhancements (titles, and centering of intervals, plus improved display of reportby vars), plus we now display 2000 data before 1990 (which we always wanted to do but could not figure how to.) John Blodgett, OSEDA, U. of Missouri Outreach & Extension. March, 2001. ---- */ options nodate linesize=132 pagesize=120 formdlim='=' noovp; *--experiment with lineszie to see if we can get sas to generate pdf files in text format instead of graphic-; *--libname user '/tmp/user'; libname pl942000 '/pub/data/pl942000'; libname pl9490tx '/pub/data/pl9490/pl9490tx' access=readonly; *<--saved 1990 pl94 extracts with 2k geography; libname user '/tmp/scratch/user'; /* proc sort data=pl9490tx.momcds90; by county geocode; run; */ proc format; value popgrp (fuzz=.01) 1='Total' 2='Hispanic or Latino' 3='White' 4='White: Non Hispanic' 5='Black / African American' 6='Asian' 6.5='Asian or Pac Islander' 7='Am. Indian or Alaska Ntv' 8='Hawaiian or other PI' 9='Some Other Race' 10='Total Multiracial'; run; title 'Public Law Population Trend Report'; footnote 'See http://mcdc2.missouri.edu/webrepts/pl94trend/Notes.html for Background Information'; footnote2 'Programming by OSEDA Under a Contract with the Missouri Census Data Center'; *<====================================MACRO=============================================================; %macro doit(state,stab,statenm,geos,arange,byvars=sumlev geocode,html=1,pdf=1,txt=1,csvfiles=1, set90=,set2000=,sort90=0,reportby=,maxobs=99999); %*--This macro handles setting up all the various parameters involved in using the %pl94trnd macro to generate a pl94 trend report. It specifies exactly which geographic entities are to be used , what output formats to generate and what decades we have data for.-- ; %let htmlfile=&statenm._&geos&arange; *--e.g. Missouri_Counties --; %let htmldir=%str(/pub/webrepts/pl94trend); %let title2=&htmlfile; %if &html %then %do; ods html file="&htmldir/&htmlfile..html" ; *include sascode('styles_default.sas')/nosource2; *---This modules sets the default html styles------; %end; %if &pdf %then %do; ods printer pdf file="&htmldir/&htmlfile..pdf" author='MCDC' ; %end; %if &txt %then %do; proc printto print="&htmldir/&htmlfile..txt" new; run; %end; %else %str(ods listing close;); %if &geos=Counties %then %let sumlevp=%str(050 040); %else %if &geos=States %then %let sumlevp=040; %else %if &geos=usregdiv %then %let sumlevp=%str(010 020 030); %else %if &geos=Places %then %let sumlevp=%str(160 161); %else %if &geos=Schools %then %let sumlevp=%str(sde sdu); %else %if &geos=CD106 %then %let sumlevp=%str(500); %else %if &geos=Senate %then %let sumlevp=%str(sen 610); %else %if &geos=House %then %let sumlevp=%str(hse 620); %else %if &geos=TAZ %then %let sumlevp=%str(taz); %else %if &geos=Tracts %then %let sumlevp=%str(140); %else %if &geos=MSAS %then %let sumlevp=%str(300 310); %else %if &geos=rpcs %then %let sumlevp=%str(rpc); %else %if &geos=Regions %then %let sumlevp=%str(reg); %else %if &geos=MCDs %then %let sumlevp=%str(060); %else %if &geos=UMExtsn %then %let sumlevp=%str(umx); %else %if &geos=CZ90 %then %let sumlevp=%str(cz); %pl94trnd(inset90=&set90,inset=&set2000,sumlevs=&sumlevp,byvars=&byvars,arange=&arange,title2=%str(&htmlfile),sort90=&sort90, csvfiles=&csvfiles,state=&state,reportby=&reportby,maxobs=&maxobs); * title2 "&htmlfile"; %if &html %then %str( ods html close; ); %if &pdf %then %str( ods printer close; ); %mend doit; options nomprint; *pl94trnd(inset90=pl9490tx.&stab.stcnty,inset=pl942000.&stab.sums,sumlevs=050 040); *macro %doit(state,stab,statenm,geos,arange,html=1,pdf=1,txt=1,csvfiles=0,set90=,set2000=); %doit(20,ks,Kansas,Counties,html=1,pdf=1,set90=pl9490tx.ksstcnty, set2000=pl942000.kssums,sort90=0,csvfiles=0) %doit(20,ks,Kansas,Places,%str(A_D),html=0,set90=pl9490tx.ksplac90, set2000=pl942000.kssums,sort90=1,csvfiles=0) %doit(20,ks,Kansas,Places,%str(E_L),html=0,set90=pl9490tx.ksplac90, set2000=pl942000.kssums,sort90=1,csvfiles=0) %doit(20,ks,Kansas,Places,%str(M_R),html=0,set90=pl9490tx.ksplac90, set2000=pl942000.kssums,sort90=1,csvfiles=0) %doit(20,ks,Kansas,Places,%str(S_Z),html=0,set90=pl9490tx.ksplac90, set2000=pl942000.kssums,sort90=1,csvfiles=0) %doit(20,ks,Kansas,Places,html=0,pdf=0,set90=pl9490tx.ksplac90, set2000=pl942000.kssums,sort90=1,csvfiles=0) %doit(20,ks,Kansas,Tracts,,byvars=county geocode,set90=,set2000=pl942000.kssums,pdf=1,html=0,csvfiles=0, reportby=County,maxobs=99999); %doit(20,ks,Kansas,MCDs,,byvars=county geocode,set90=pl9490tx.ksmcds90,set2000=pl942000.kssums,pdf=0,html=0,csvfiles=1, reportby=County,maxobs=99999); %doit(20,ks,Kansas,Tracts,,byvars=county geocode,set90=,set2000=pl942000.kssums,pdf=1,html=0,csvfiles=0, reportby=County,maxobs=99999); run; %doit(17,il,Illinois,Counties,html=1,pdf=1,set90=pl9490tx.ilstcnty, set2000=pl942000.ilsums,sort90=0,csvfiles=0) %doit(17,il,Illinois,Places,%str(A_D),html=0,set90=pl9490tx.ilplac90, set2000=pl942000.ilsums,sort90=1,csvfiles=0) %doit(17,il,Illinois,Places,%str(E_L),html=0,set90=pl9490tx.ilplac90, set2000=pl942000.ilsums,sort90=1,csvfiles=0) %doit(17,il,Illinois,Places,%str(M_R),html=0,set90=pl9490tx.ilplac90, set2000=pl942000.ilsums,sort90=1,csvfiles=0) %doit(17,il,Illinois,Places,%str(S_Z),html=0,set90=pl9490tx.ilplac90, set2000=pl942000.ilsums,sort90=1,csvfiles=0) %doit(17,il,Illinois,Places,html=0,pdf=0,set90=pl9490tx.ilplac90, set2000=pl942000.ilsums,sort90=1,csvfiles=0) %doit(17,il,Illinois,MCDs,,byvars=county geocode,set90=pl9490tx.ilmcds90,set2000=pl942000.ilsums,pdf=0,html=0, sort90=1,csvfiles=1, reportby=County,maxobs=99999); %doit(17,il,Illinois,Tracts,,byvars=county geocode,set90=,set2000=pl942000.ilsums,pdf=1,html=0,csvfiles=0, reportby=County,maxobs=99999); run; /*<=========================Comment out===================================== %doit(29,mo,Missouri,Counties,html=1,pdf=1,set90=pl9490tx.mostcnty, set2000=pl942000.mosums,sort90=0,csvfiles=0) %doit(29,mo,Missouri,Places,%str(A_D),html=0,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) %doit(29,mo,Missouri,Places,%str(E_L),html=0,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) %doit(29,mo,Missouri,Places,%str(M_R),html=0,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) %doit(29,mo,Missouri,Places,%str(S_Z),html=0,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) %doit(29,mo,Missouri,Places,html=0,pdf=0,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) run; ****The following 3 legislative district reports should be run again after geocode vars are fixed--; %doit(29,mo,Missouri,CD106,,byvars=geocode,set90=pl9490tx.mocd0600,set2000=pl942000.mocds106,pdf=1,html=0,csvfiles=1); %doit(29,mo,Missouri,House,,byvars=geocode,set90=pl9490tx.mohse00,set2000=pl942000.mohouse,pdf=1,html=0,csvfiles=1); %doit(29,mo,Missouri,Senate,,byvars=geocode,set90=pl9490tx.mosen00,set2000=pl942000.mosenate,pdf=1,html=0,csvfiles=1); %doit(29,mo,Missouri,TAZ,,byvars=geocode,set90=pl9490tx.motaz00,set2000=pl942000.motaz,pdf=1,html=0,csvfiles=0); %doit(29,mo,Missouri,Tracts,,byvars=county geocode,set90=pl9490tx.motrs00,set2000=pl942000.mosums,pdf=1,html=0,csvfiles=0, reportby=County,maxobs=99999); %doit(29,mo,Missouri,MSAS,,byvars=geocode,set90=pl9490tx.momsas00,set2000=pl942000.momsas00,pdf=1,html=0,csvfiles=0, reportby=,maxobs=99999); %doit(29,mo,Missouri,Schools,,byvars=desedist,set90=pl9490tx.moschl00,set2000=pl942000.moschls,pdf=1,html=0,csvfiles=0); %doit(29,mo,Missouri,MCDs,,byvars=county geocode,set90=pl9490tx.momcds90,set2000=pl942000.mosums,pdf=1,html=0,csvfiles=0, reportby=County); %doit(29,mo,Missouri,UMExtsn,,byvars=geocode,set90=pl9490tx.umextrgn,set2000=pl942000.umextrgn,pdf=1,html=1,csvfiles=0); %doit(29,mo,Missouri,CZ90,,byvars=geocode,set90=pl9490tx.mocz90,set2000=pl942000.mocz90,pdf=0,html=1,csvfiles=0); %doit(29,mo,Missouri,Regions,,byvars=geocode,set90=pl9490tx.moregns,set2000=pl942000.moregns,pdf=1,html=1,csvfiles=0); %doit(29,mo,Missouri,rpcs,,byvars=geocode,set90=pl9490tx.morpcs,set2000=pl942000.morpcs,pdf=1,html=1,csvfiles=0); ===========================End commented out================================ */ /*<=========================Comment out===================================== %doit(00,us,US,States,,byvars=geocode,set90=pl9490tx.usstates,set2000=pl942000.usstates,pdf=1,html=1,csvfiles=0); %doit(00,us,US,usregdiv,,byvars=sumlev geocode,set90=pl9490tx.usregdiv,set2000=pl942000.usregdiv,pdf=1,html=1,csvfiles=0); %doit(00,us,US,Counties,,byvars=state geocode,set90=pl9490tx.uscntys,set2000=pl942000.uscntys,pdf=0,html=0,csvfiles=0, reportby=State,maxobs=99999); %doit(00,us,US,Places,%str(A_D),byvars=state geocode, set90=pl9490tx.usplaces, set2000=pl942000.usplaces,sort90=0, pdf=0,html=0,csvfiles=0,reportby=State) %doit(00,us,US,Places,%str(E_L),byvars=state geocode, set90=pl9490tx.usplaces, set2000=pl942000.usplaces,sort90=0, pdf=0,html=0,csvfiles=0,reportby=State) %doit(00,us,US,Places,%str(M_R),byvars=state geocode, set90=pl9490tx.usplaces, set2000=pl942000.usplaces,sort90=0, pdf=0,html=0,csvfiles=0,reportby=State) %doit(00,us,US,Places,%str(S_Z),byvars=state geocode, set90=pl9490tx.usplaces, set2000=pl942000.usplaces,sort90=0, pdf=0,html=0,csvfiles=0,reportby=State) %doit(00,us,US,Places,set90=pl9490tx.usplaces, set2000=pl942000.usplaces,sort90=0, txt=0,html=0,pdf=0,csvfiles=0) *---5-14-01: Regenerate counties and places (MO) using v8.2------------*; %doit(29,mo,Missouri,Counties,html=0,pdf=1,set90=pl9490tx.mostcnty, set2000=pl942000.mosums,sort90=0,csvfiles=0) %doit(29,mo,Missouri,Places,html=0,pdf=1,set90=pl9490tx.moplac90, set2000=pl942000.mosums,sort90=1,csvfiles=0) ===========================End commented out================================ */ run; %include sascode(notify);