x cd /pub/data/georef/Tools; %let pgm=moblk2ur10; filename pgm "&pgm..sas"; *---Read the 2010 Missouri Census block to Ur (urban rural) with UA and Urbank cluster codes from J. Harlna. April 23, 2012. jgb, OSEDA,---; filename dbfin "../ur_block.dbf"; libname georef '/pub/data/georef'; %libname (sf12010x); proc import datafile=dbfin dbms=dbf replace out=out; getdel=no; run; data out; set out; length County $5 Tract $7 Block $4; county=substr(geoid10,1,5); Tract=substr(geoid10,6,4)||'.'||substr(geoid10,10,2); Block=substr(geoid10,12,4); drop uaname10 geoid10; proc sort ; by county tract block; run; proc sort data=sf12010x.moblocks(keep=county tract block totpop) out=sf1pops; by county tract block; run; data georef.&pgm(label='Missouri block to UA equiv 2010') ; merge out(in=inclist) sf1pops(in=insf1); by county tract block; if not (inclist and insf1) then do; put '**data not matched: ' county= $mocnty. _all_; _nbad+1; if _nbad ge 20 then abort abend; else if inclist; end; drop _: ; rename uace10=UA ur10=UR; label UA="Urbanized Area or Urban Cluster Code" UR="Urban/Rural"; run; proc contents data=georef.&pgm; proc print data=georef.&pgm(obs=50);