x cd /pub/data/georef/Tools; %let pgm=mocbsasYY_webrept; filename pgm "&pgm..sas"; *--create webrepts/geography/mocbsas&yr..pdf for year specified--; *---rerun 10-22-09 with new cbsacos data set using the nov 2008 defns. Reports Cape Girardeau as metropolitan SA.--; *--run 4/10 to get the 2009 pop estimates--; %let cbsayear=2009; %let cbsayr=%substr(&cbsayear,3,2); %let popestyr=09; *<--- we get population estiamtes and msacmsa/pmsa codes from popests.uscom&popestyr --; libname georef '/pub/data/georef'; libname popests '/pub/data/popests' access=readonly; options nofmterr; *---------------Generate a web report showing the data for Missouri --------; ods listing close; ods printer pdf style=sasweb file="/pub/reports/geography/mocbsas&cbsayr..pdf"; options nodate; *---create report file where we combine codes and names into single fields--; data report; set georef.cbsacos(rename=(cbsa=cbsacode) drop=county); where state='29' or put(cbsacode,$cbsa.) contains("MO") ; if cbsacode ne ' '; length CBSA $100 County $40; cbsa=cbsacode||' '||put(cbsacode,$cbsa.); County=fipco|| ' '|| put(fipco,$county.); keep cbsa county popcen2k popjl&popestyr; format popjl&popestyr comma9.; run; proc sort data=report; by cbsa county; run; proc print data=report label; title 'Missouri Core Based (Metropolitan and Micropolitan) Statistical Areas (CBSA''s)'; title2 "County Components as Defined by OMB, November, &cbsayear"; title3 .h=.8 'Report Shows CBSA''s Entirely or Partially Within Missouri'; footnote .h=.7 "Generated by mocbsasYY_webrepts.sas in georef/Tools on &sysdate"; by cbsa ; id cbsa; var county Popcen2k PopJL&popestyr; label Popcen2k='Census 2k Pop' Popjl&popestyr="July 20&popestyr Pop Est"; run; ods printer close;