x cd /pub/data/corrlst/Tools; %let pgm=mobl2mpo; filename pgm "&pgm..sas"; *--Read the CSV file uploaded by Lance H. and create the Missouri 2000-census block to MoDOT MPO (Metropolitican Planning Organization) correlation list. We also generate the $mponame format code for linking names with the mpo codes. JGB, 9-23-02 *<=============IMPORTANT!!! See setup in mobl2mpop03 where we update the lists using new defns as of 2003.=== *<=====comment-only editing done prior to coding moblmpo03 7-1-2003=== --*; libname corrlst '/pub/data/corrlst'; libname georef '/pub/data/georef'; libname sf12000x '/pub/data/sf12000x'; filename in '../mobl2mpo.csv' ; filename text '/pub/sas/formats/Smponame.sas'; title "&pgm: Create Geographic Files for MODOT MPO Codes"; proc datasets library=sf12000x nolist; modify moblks; index create cotrbl=(county tract block); quit; *---Note that not all blocks are in an MPO so not all blocks are in this corrlst dataset*; data &pgm(label="Mo 2000 Block to MODOT MPO as of 9/02" drop=mponame ) mponames(keep=mpo mponame) nonmocos(keep=county); infile in dsd missover firstobs=2; length county $5 tract $7 block $4 mpo $1 mponame $32 esriid $16; input @2 _dum county tract block esriid mponame mpo; if not (county=:'29') then do; *--Lance added the blocks in Ks and Il for MARC and EWGCC--; if county ne lag(county) then output nonmocos; return; end; tract=substr(tract,1,4)||'.'||substr(tract,5,2); output &pgm; if mponame ne lag(mponame) then output mponames; drop _dum esriid; run; proc freq data =nonmocos; run; proc sort data=&pgm; by county tract block; run; data corrlst.&pgm; merge &pgm(in=in1) sf12000x.moblks(keep=county tract block totpop in=in2); by county tract block; if in1; rename totpop=pop100; if not in2 then totpop=0; run; proc sort data=mponames out=georef.mpos(label='MoDOT MPO codes and names') nodupkeys; by mpo mponame; run; proc print data=georef.mpos; title2 'georef.mpos'; title3 'Used to create $mponame format Code'; run; %genfmat(setin=georef.mpos,fmtname=mponame,argvars=mpo,arglen=1,labelvar=mponame,labellen=32) run; data _null_; infile text; input; list; run; proc freq data=corrlst.&pgm (keep=county mpo); table county*mpo /list; format county $mocnty. mpo $mponame.; title2 'County by MPO Freq Count (# of blocks)'; title3 'Not All Blocks Assigned -- Only Those Within MPOs'; run; proc print data=corrlst.&pgm(obs=50); by county; title2 "corrlst.&pgm"; run;