*--This module was run from the jgb desktop 12-21-2001. We have copies of the original .zip file attachments sent by Ryan here in corrlst dir. We are saving this setup on the mcdc box to document the conversion, which involves creating geocodes in the MCDC standard formats with standard names, etc. jgb, 12.31.01. ---*; *----Step 0: Use Proc DBF from Windows to convert the dbf files from R. Burson to SAS sets-----*; filename dbf3file 'c:\temp\2001 CONGRESSIONAL DISTRICTS.dbf'; *--unzipped--; filename housedbf 'c:\temp\house.dbf'; *--unzipped and renamed--; filename sendbf 'c:\temp\senate.dbf'; *--unzipped and renamed--; signon mcdc; *<===================================NOTE==========================================; libname corrlst '/pub/data/corrlst' server=mcdc; *<=====output goes to the mcdc AIX box=========; proc dbf db3=dbf3file out=mobl2cd; run; proc dbf db3=housedbf out=mobl2house; run; proc dbf db3=sendbf out=mobl2senate; run; proc sort data=mobl2cd; by blk ; run; proc sort data=mobl2house; by blk ; run; proc sort data=mobl2senate; by blk ; run; *---now create the permanent copies of the sas data sets by breaking down the block variables into their geocode components per std data archive naming conventions.---; data corrlst.mobl2cd108(label='MO block to 108th Cong District (2002)' sortedby=county tract block); set mobl2cd (obs=max); length county $5 tract $7 block $4 cd108 $2 year $4; label cd108='108th Congressional District (2002)' tract='2000 Census Tract' block='2000 Census Block' year='Year effective'; retain year '2002'; county=substr(blk,1,5); tract=substr(blk,6,4)||'.'||substr(blk,10,2); block=substr(blk,12,4); cd108='0'||districtid; drop blk districtid; run; data corrlst.mobl2senate(label='MO block to State Senate District (2002)' sortedby=county tract block); set mobl2senate (obs=max) ; length county $5 tract $7 block $4 sldu $3 year $4; label sldu='State Leg District Upper (Senate)- 2002' tract='2000 Census Tract' block='2000 Census Block' year='Year effective'; retain year '2002'; county=substr(blk,1,5); tract=substr(blk,6,4)||'.'||substr(blk,10,2); block=substr(blk,12,4); sldu='0'||districtid; drop blk districtid; run; data corrlst.mobl2house(label='MO block to State House District (2002)' sortedby=county tract block); set mobl2house (obs=max) ; length county $5 tract $7 block $4 sldl $3 year $4; label sldl='State Leg District Lower (House)- 2002' tract='2000 Census Tract' block='2000 Census Block' year='Year effective'; retain year '2002'; county=substr(blk,1,5); tract=substr(blk,6,4)||'.'||substr(blk,10,2); block=substr(blk,12,4); sldl=districtid; drop blk districtid; run;