x cd /pub/data/pl9490/Tools; %let pgm=pl94trend_aggmoblk00; 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. An earlier run converted 1990 pl94 data at the block level to create pl9490tx.moblks00 - 1990 data summarized by 2000 block geography. In this setup we aggregate that data set to create summaries for various other geographic levels, including: State legislative districts (cd106, state house and senate) Unified and elementary school districts. ZCTA's will be done later after we get the blk2k - zcta corr. list. jgb, 3-16-01. ---*; %libname(pl942000); libname pl9490tx '/pub/data/pl9490/pl9490tx'; libname user '/SAS_temp/user'; /*<=========================Comment out===================================== *---Link the 2000 block geos to the moblks00 data set and create the agg input sets---; proc sort data=pl942000.mogeos(keep=sumlev county tract block cd106 sldl sldu taz sdelm sduni ) out=mogeos; by county tract block; data aggin; length geocode $6; merge pl9490tx.moblks00(in=ind) mogeos(in=ing); by county tract block; if ind; *--0 sum and a few other blocks will not be there--; if totpop; *--ignore unpopulated blocks-; if not ing then do; _nogeos+1; put /'***no geos for ' county= tract= block= ; if _nogeos ge 50 then stop; delete; end; if sdelm ne ' ' then do; sumlev='sde'; geocode=sdelm; output; end; if sduni ne ' ' then do; sumlev='sdu'; geocode=sduni; output; end; sumlev='sen'; geocode=sldu; output; *--state senate districts; sumlev='hse'; geocode=sldl; output; *--state house of representatives-; sumlev='500'; geocode=cd106; output; *--congressional district (106th congress, elected 1998)-; if taz not in (' ','999999') then do; sumlev='taz'; geocode=taz; output; end; run; proc sort; by sumlev geocode; run; %agg(aggin=aggin,aggout=aggout,aggby=sumlev geocode,aggvars=totpop--wnovr181,agglvl=1) run; data pl9490tx.mosde00(label='1990 pl94 extract by 2000 elementary school dists') pl9490tx.mosdu00(label='1990 pl94 extract by 2000 unified school dists') pl9490tx.mosen00(label='1990 pl94 extract by 2000 state senate dists' drop=desedist) pl9490tx.mohse00(label='1990 pl94 extract by 2000 state house dists' drop=desedist) pl9490tx.mocd0600(label='1990 pl94 extract by 106th congressional dists' drop=desedist) pl9490tx.motaz00(label='1990 pl94 extract by Tran Analysis Zones' drop=desedist) ; length areaname $40; set aggout; select (sumlev); when('sde') do; areaname=put(geocode,$school.); desedist=put(geocode,$schcnvt.); *--add dese codes and the dist name-; output pl9490tx.mosde00; end; when('sdu') do; areaname=put(geocode,$school.); desedist=put(geocode,$schcnvt.); *--add dese codes and the dist name-; output pl9490tx.mosdu00; end; when('sen') do; areaname='MO State Senate District '||geocode; output pl9490tx.mosen00; end; when('hse') do; areaname='MO House District '||geocode; output pl9490tx.mohse00; end; when('500') do; areaname='Congessional District (106th) '||geocode; output pl9490tx.mocd0600; end; when('taz') do; areaname='Transportation Zone '||geocode; output pl9490tx.motaz00; end; otherwise do; put /'***Unexpected value for sumlev code: ' sumlev= geocode= / _all_; delete; end; end; *--select--; drop _lvl_ _nag_; run; %macro prnt50(set); proc print data=pl9490tx.&set(obs=50); by sumlev; id geocode areaname; var totpop--asianpi; title2 "Partial Listing of Selected Vars from pl9490tx.&set"; run; %mend prnt50; %prnt50(mosde00); %prnt50(mosdu00); %prnt50(mosldu00); %prnt50(mosldl00); %prnt50(mocd0600); %prnt50(motaz00); ===========================End commented out================================ */ *---Combine the 2 school district files for consistency with the version created from pl942000--; data pl9490tx.moschl00; set pl9490tx.mosde00 pl9490tx.mosdu00; run; proc sort; by desedist; run;