x cd /pub/data/corrlst/Tools; %let pgm=moblkzcta10; filename pgm "&pgm..sas"; *---Read the 2010 Missouri block to ZCTA equivalency file, creating corrlst.moblkzcta10 . Source of these data is the U.S. Census Bureia by way of Jim Harlan's processing (at the Geographic Resources Center, MU). jgb , oseda, under contract with the Mo Census Data Center. June, 2011. ---*; filename csvin "/pub/data/corrlst/&pgm..csv"; libname corrlst '/pub/data/corrlst'; %libname (pl942010); libname user '/SAS_temp/userb'; /* ========================begin comment==================================== data blks; infile csvin dsd firstobs=2 termstr=crlf; length County $5 Tract $7 Block $4; length _case $8 _freq $4 ZCTA $5 blkgeoid $15; input _case--blkgeoid; County=substr(blkgeoid,1,5); tract=substr(blkgeoid,6,4)||'.'||substr(blkgeoid,10,2); Block=substr(blkgeoid,12,4); drop blkgeoid _: ; run; proc sort; by county tract block; run; data pl94; set pl942010.mosums(keep=sumlev county tract block TotPop Landsqmi TotHUs where=(sumlev='750')); run; proc sort; by county tract block; run; ==========================end comment====================================== */ data corrlst.&pgm(label="Missouri 2010 Census Block to ZCTA Correlation List" index=(county) sortedby=county); merge blks(in=inclist) pl94(in=inpl94); by county tract block; if not (inclist and inpl94) then do; put "**Unmatched block: " county= tract= block= totpop= inclist= inpl94=; _nbad+1; if _nbad ge 1000 then abort abend; end; drop sumlev _nbad; run; proc print data=corrlst.&pgm(obs=500); title "partial listing of corrlst.&pgm"; by county; sum totpop; run; proc freq data=corrlst.&pgm; table county; format county $mocnty.; run;