x cd /pub/data/stf903/Tools; %let pgm=uszipsxy; filename pgm "&pgm..sas"; *---Merge some geographic vars from stf903x.zipxys with newly-converted uszips to create the view stf903.uszipsxy. Rerun 7-2003 after reconverting the sf3b files. ---; libname stf903 '/pub/data/stf903'; %libname(stf903x); data stf903.uszipsxy(label='Complete (800 slvl) ZIP sums with 3 extra geo variables')/ view=stf903.uszipsxy; merge '/pub/data/stf903x/zipxys'(keep=zip areasqmi intptlng intptlat firstobs=3 in=inxys) '/pub/data/stf903/uszips'(in=instf3); by zip; format arealand 12.3 intptlng 11.6 intptlat 10.6; if not inxys then put '***No xy data for ' zip=; if not instf3 then do; put '***No stf3 data for ' zip=; delete; end; if stab='##' then select(state); when('29') stab='MO'; when ('21') stab='KY'; when ('12') stab='FL'; otherwise; end; if first.zip then do; if not last.zip then do; areasqmi=.; intptlng=.; intptlat=.; end; else AreaLand=areasqmi/.3860342; output; end; **else put '****Duplicated zip deleted" ' zip= ; label AreaLand='Land Area in Square KMs'; **** drop areasqmi; run; proc means data=stf903.uszipsxy n sum mean; class state; var arealand areasqmi; run ;