x cd /pub/data/georef/Tools; %let pgm=moblks00; filename pgm "&pgm..sas"; *--Create georef.moblks00 with all current data for 2000 Missouri census blocks including: all relevant data from the sf12000.mogeos data set location (name of area most associated with - see setup in genlocs.sas in this same dir.) state leg. district codes cd108, senate02 and house02 reflecting new codes after 2001 redistricting We plan to update this data set from time to time when new data is delivered (such as urban/rural). Coded by John Blodgett, OSEDA, U. of Missouri Outreach & Extension, under contract with MCDC. 01.02.02--; libname sf12000 '/pub/data/census_2000/sf12000' access=readonly; libname corrlst '/pub/data/corrlst' access=readonly; libname georef '/pub/data/georef'; libname user '/tmp/storage/john'; options ls=155 nodate ps=80; title 'georef.moblks00'; proc sort data=sf12000.mogeos(where=(SumLev='101') keep=geo_id SumLev state stab county tract bg block cousubfp cousubcc cousubsc placefp placecc placedc placesc msacmsa urbanrur cd106 sldu sldl vtd vtdi zcta5 funcstat pop100 hu100 intptlat intptlon sdelm sduni taz landsqmi areasqmi rename=(geo_id=geo_id_sf1)) out=sf1geos; by county tract block; run; data georef.moblks00(label='Missouri Block Geography, 2000 and later' index=(county) sortedby=county tract block); merge sf1geos(in=insf1) corrlst.mobl2house(in=inhouse rename=(sldl=sldl02)) corrlst.mobl2senate(in=insenate rename=(sldu=sldu02)) corrlst.mobl2cd108(in=incd108 ); length county fipco $5 tract $7 block $4 location $16; by county tract block; ***where county='29001'; if not (insf1 and inhouse and insenate and incd108) then do; _nbad+1; if _nbad le 100 then put _n_= county= tract= block= insf1= inhouse= insenate= incd108=; else abort abend; drop _nbad; end; location=county||tract||block; format location $moblloc.; format county $mocnty.; fipco=county; drop year; label sldl='State House District 1992' sldu='State Senate District 1992' sldl02='State House District 2002' sldu02='State Senate District 2002'; run; proc datasets library=georef; modify moblks00; index create geo_id_sf1 / unique; quit; proc contents data=georef.moblks00 position; run; proc print data=georef.moblks00(obs=50); by county; id tract block; run;