x cd /pub/data/pl9490/Tools; %let pgm=pl94trend_90geog_mo; filename pgm "&pgm..sas"; *---This setup will generate sas datasets in the pl9490tx subdirectory of pl9490. These sets are suitable for use as input to the pl94 trend reports that allow juxtaposing basic pl94 pop data for 1990 and 2000. This setup generates data for Missouri where we use the 1990 geography. Another setup will be used to generate data converted to 2000 geocodes. jgb, 3-7-01. ---*; *---Originally run under sas6.12 on oseda platform. Edited for v8 on mcdc system, 6-1-01---; libname pl9490 '/pub/data/pl9490' access=readonly; libname pl9490tx '/pub/data/pl9490/pl9490tx'; libname user '/SAS_temp/user'; *-----------All Missouri data in this setup-------------*; *--mod 6-1-01 to now create sl155 summaries by aggregating 1990 pl94 720 summaries (county-mcd-place)-; data aggin; set pl9490.monblks; where slvl='720' and p1i1 > 0; totpop=p1i1; tothus=h1i1; *<-----keep the total households even if it is not in the trend reports because not on 2000; white1=p2i1; black1=p2i2; indian1=p2i3; asianpi=p2i4; *--NOT the same as a 1990 category-; other1=p2i5; whovr181=p3i1; blovr181=p3i2; inovr181=p3i3; aspovr18=p3i4; otovr181=p3i5; over18=sum(of p3i1-p3i5); hisppop=p4i1; whitenh1=p4i2; hisovr18=p5i1; wnovr181=p5i2; label totpop='1990 complete count pop'; keep slvl county placefp totpop -- wnovr181 ; *--only keep mostly the new variable (names)--; run; proc sort; by county placefp; run; %agg(aggin=aggin,aggout=aggout,aggby=slvl county placefp,agglvls=3,aggvars=totpop--wnovr181) run; data tots pl9490tx.mosl15590(label='Place within County summaries using 90 place defns'); length geocode $11 areaname $48; set aggout; geocode = %concatd(county,placefp); if _lvl_=1 then if placefp ne '99999' then areaname=put(placefp,$mofplace.); else areaname='Remainder of '||put(county,$county.); slvl='155'; if _lvl_=1 then output pl9490tx.mosl15590; else output tots; drop _lvl_ _nag_; run; proc print data=tots; var slvl county totpop; format county $county.; run; /*<=========================Comment out===================================== *--------Generate data for state, county, mcd and place with unchanged geography (i.e. 1990 geography)--; data pl9490tx.mostcnty pl9490tx.moplac90(label='Place Data Using 90 Geography') pl9490tx.momcds90(label='MCD Data Using 90 Geography'); set pl9490.monblks; where slvl in ('040','050','060','160','720'); *--borrow code from that used to create the 2k pl94 data sets--; length default=5; *block=blk; SumLev=slvl; *--Same item, new name--; length geocode $32; select(SumLev); *---Assign the standardized Geographic Code to uniquely ID the geographic area--; * when('750') geocode=%concatd(county,vtd,tract,block); * when('740') geocode=%concatd(county,vtd,cousubfp,placefp,tract,bg); * when('700') geocode=%concatd(county,vtd); * when('620') geocode=%concatd(state,sldu); * when('610') geocode=%concatd(state,sldl); * when('500') geocode=%concatd(state,cd); * when('172') geocode=%concatd(state,concit,placefp); * when('170') geocode=%concatd(state,concit); when('160') geocode=%concatd(state,placefp); * when('140') geocode=%concatd(county,tract); when('060') geocode=%concatd(county,cousubfp); when('050') geocode=county; when('040') geocode=state; otherwise do; *<====We have not yet done code for the various Alaskan and Indian geo levels--; if '280' le SumLev le '285' then geocode=' '; else put '****Unexpected SumLev code encountered: No value assigned to geocode: ' SumLev= areaname=; abort 500; end; end; *--select group--; *--assign all the vars to corresponding names used in the pl94-2000 mosums data set(s)--; totpop=p1i1; white1=p2i1; black1=p2i2; indian1=p2i3; asianpi=p2i4; *--NOT the same as a 1990 category-; other1=p2i5; whovr181=p3i1; blovr181=p3i2; inovr181=p3i3; aspovr18=p3i4; otovr181=p3i5; over18=sum(of p3i1-p3i5); hisppop=p4i1; whitenh1=p4i2; hisovr18=p5i1; wnovr181=p5i2; if sumlev in ('040','050') then output pl9490tx.mostcnty; else if sumlev='060' then output pl9490tx.momcds90; else if sumlev='160' then output pl9490tx.moplac90; else do; put //'***Logic Error - Unexpected sumlev value: ' /_all_; abort 700; end; label totpop='1990 complete count pop'; keep areaname state county sumlev geocode totpop -- wnovr181; *--only keep mostly the new variable (names)--; run; ===========================End commented out================================ */