x cd /pub/data/georef/Tools; %let pgm=cbsa_changes; filename pgm "&pgm..sas"; *---gnerate a report showing changes in CBSA defintions at the county level. We create the datset georef.cocbsachanges showing what changed in the most recent year. In this case it is between the Nov 2009 and Feb 2013 geographic defn files. jgb, 9/10. ---; libname georef '/pub/data/georef'; %let year=2013; %let yrm1=%eval( %substr(&year,3,2) - 1); data georef.cocbsachanges(label='Counties with changed CBSA status, 2008 to 2009'); merge georef.cbsacos09(in=inold rename=(cbsa=cbsaold metrodiv=metrodivold cbsatype=cbsatypeold)) georef.cbsacos13(in=innew); by county; if not (inold and innew) then do; _nomatch+1; if _nomatch le 25 then put "**County not matched: " fipco= inold= innew=; else abort abend; end; if cbsa ne cbsaold or (metrodivold ne metrodiv) or (cbsatypeold ne cbsatype); keep State fipco county cbsaold cbsa cbsatypeold cbsatype metrodivold metrodiv popjl&yrm1.; keep Year; cbsaname=cbsa; cbsanameold=cbsaold; format cbsaname cbsanameold $cbsa.; keep cbsaname cbsanameold; run; ods html file="/pub/reports/&pgm._&year" style=sasweb; options ls=160 ps=80; proc print data=georef.cocbsachanges; title "Counties With Change in CBSA or MetroDiv Status in Latest Geographic Update"; title2 "November, 2009 vs. February, 2013"; by state ; format state $state.; label state='State'; id fipco county ; var cbsaold cbsa cbsaname cbsanameold metrodiv metrodivold cbsatype cbsatypeold popjl&yrm1.; run;