x cd /pub/data/georef/Tools; %let pgm=uspumas2012; filename pgm "&pgm..sas"; *---Convert the downloaded gaxzetteer file with the new (as of summer 2012) the new Public Use Microdata Area codes and names. jgb, 7-16-12. ---*; libname georef '/pub/data/georef'; filename gazin '/pub/data/georef/Gaz_puma_national.txt'; data georef.&pgm(label="US PUMAs as of 2012"); infile gazin firstobs=2 dlm='09'x missover; ***termstr=crlf obs=max ; *---For the first time ever the Bureau has created names for the PUMAs. (Or at least they had the states create them).-; length State Stab $2 geocode $7 PUMA $5 Areaname $96 Arealand AreaWater LandSQMI _WaterSQMI IntPtLat IntPtLon 8; input Stab geocode Areaname Arealand--IntPtLon; if stab=' ' then delete; *---There were a series of tabs-only line at end of file.----; *--remove work PUMA from end of areaname---; _lan=length(areaname); if substr(areaname,_lan-3)='PUMA' then substr(areaname,_lan-3)=' '; else put "Truncated Areaname " _all_; State=substr(geocode,1,2); puma=substr(geocode,3,5); if _n_ le 2 then do; list; put _all_; end; AreaSQMI=LandSQMI + _WaterSQMI; label arealand='Land Area in Sq KMs' AreaWater='Water Area in SQ KMs'; label LandSQMI='Land Area in Sq Miles' AreaSQMI='Total Area in SQ Miles'; format landsqmi areasqmi 9.2 IntPtLat 9.6 IntPtLon 11.6; drop _: ; run; proc print data=georef.&pgm(where=(state='29')); by state stab; run; proc freq data=georef.&pgm; table stab; run;