x cd /mscdc/data/georef/Tools; %let pgm=zipmarpt; filename pgm "&pgm..sas"; *--generate report showing changes in metro area assignments by county between the 90 census (stf3b as source) and using current $zipmetr format table--; data zipchng; *<---zips with different metro area than on stf3b---; set stf903x.uszips(keep=zip state county slvl msacmsa totpop); where slvl='800'; length metro95 $5; fipco=county; format county $county24.; if msacmsa="''" then msacmsa=' '; metro95=put(zip,$zipmetr.); if msacmsa =: metro95 then delete; length metnam90 metnam95 $32; if metro95 ne ' ' then metnam95=put(substr(metro95,1,4),$metro95_.); if msacmsa ne ' ' then metnam90=put(msacmsa,$metro95_.); run; proc sort; by county msacmsa metro95; %agg(setin=zipchng,setout=zipcagg,aggby=county msacmsa metro95, idvars=metnam90 metnam95 fipco,aggvars=totpop, dropvars=_lvl_) run; proc print data=zipcagg(rename=(_nag_=nzips)); id fipco county; var msacmsa metnam90 metro95 metnam95 nzips totpop; format totpop comma11.; title 'Count of ZIPs with Total 90 Pops By County:'; title2 'Where MSACMSA from STF3B Does Not Match Metro Code Assigned for 95'; run;