x cd /pub/data/georef/Tools; %let pgm=mocogeomaps; filename pgm "&pgm..sas"; *---Generate maps of the county-based regions in georef.mocogeos14. jgb, 7-2-14. rev. 8-20-14 to add UMX stuff. ---*; libname sasmaps '/pub/sasmaps'; *---our gmap data sets (not the ones that come directly from SAS I) ---; *--The maps libref is automatic. It contains the gmap data sets direct from SAS I--; %let mapdir=%str(/pub/data/georef/mocogeomaps); *--where we store the output gif files--; libname georef '/pub/data/georef' access=readonly; /*<=========================Comment out===================================== libname flib '/pub/sas/catalogs'; *--ran this code interactively to get latest $umxname compiled--; proc format library=flib; %include '/pub/sas/formats/Sumxname.sas'; run; ===========================End commented out================================ */ *---S0: Create MO subset of maps.counties for MO. -----; data sasmaps.mocounties(label="MO subset of maps.counties"); set maps.counties; where state=29; x=-x; *--otherwise map displays backwards (!!)--; run cancel; *--already have it---; data gmapdata1; set georef.mocogeos14(drop=state county cnty areaname sumlev ); length State County 4; state=substr(fipco,1,2); county=substr(fipco,3,3); run; goptions reset=global; goptions COLORS= ( indigo RED GREEN BLUE CYAN MAGENTA GRAY PINK ORANGE BROWN YELLOW olive teal purple); ***BLACK RED GREEN BLUE CYAN MAGENTA GRAY PINK ORANGE BROWN YELLOW olive teal purple); ***BISQUE CORAL LIME MAROON DARKGRAY DEEPPINK DIMGRAY NAVY); *** OLIVE PERU PLUM GOLD THISTLE HOTPINK INDIGO KHAKI LAVENDER PURPLE SIENNA SILVER SKYBLUE TAN TEAL TOMATO VIOLET WHEAT ); goptions device=gif; ***proc goptions; run; title h=1 "Missouri County-based Regions"; **goptions gsfname=gsfout gsfmode=append; goptions ftext=swissb transparency noninterlaced htitle=1 ctitle=navy ; goptions cby=navy hby=2; ods html body="gmaps.html" path="&mapdir"; footnote h=.7 "From setup in georef/Tools/&pgm..sas"; footnote2 h=.7 "Accesses Data in georef.mocogeos14"; pattern1 value=s; pattern2 value=m3x45; *pattern3 value=r3; legend across=2 cframe=lavender frame fwidth=2 cborder=purple label=none; *---We would like to do this all in one proc gmap step but there is no way we can get it to recognize our title2 statement for different choro statements. So we need to invoke the proc gmap once per map. The gm macro lets us save typing and be sure we are consistent. ---; %macro gm; run; proc gmap map=sasmaps.mocounties data=gmapdata1; id state county; %mend gm; %gm choro rpc / discrete legend=legend1; title2 .c=purple h=1.5 'Regional Planning Commissions'; label rpc='Regional Planning Commission'; format rpc $rpcname32.; %gm choro dot / discrete legend=legend1; title2 .c=purple h=1.5 'MoDOT Districts'; label dot='MoDOT Region'; format dot $modot.; *choro CBSA / discrete ; *label CBSA ='Metro/Micro politan Regions (As of Feb 2013)'; *format cbsa $cbsa30.; %gm choro metrosa / discrete legend=legend1; label metrosa='Metropolitan SA'; title2 .c=purple h=1.5 'Metropolitan Statistical Areas'; format metrosa $cbsa.; %gm choro microsa / discrete legend=legend1; label microsa='Micropolitan SA'; title2 .c=purple h=1.5 'Micropolitan Statistical Areas'; format microsa $cbsa.; %gm choro aaa / discrete legend=legend1; title2 .c=purple h=1.5 'Area Agencies on Aging'; format aaa $aaa.; %gm choro ded_region / discrete legend=legend1; title2 .c=purple h=1.5 'DED Economic Regions'; format ded_region $dedrgn.; %gm choro umx2 / discrete legend=legend1; title2 .c=purple h=1.5 'U of Missouri Extension Regions (Vintage 2010)'; format umx2 $umxname.; run; ods html close; *---Now do a set of reports showing which counties comprise which regions---; footnote h=.7 "From setup in georef/Tools/mocogeomaps.sas using data in georef.mocogeos14"; footnote2 h=1 "Missouri Census Data Center, &sysdate &systime"; %macro rept(rvar,rnamevar,region_name,morevars); proc sort data=georef.mocogeos14(keep=areaname fipco pop2k pop10 popjl13 &rvar &rnamevar &morevars where=(&rvar ne ' ') ) out=temp&rvar; by &rvar fipco; label pop10='Total Pop,2010' pop2k='Total Pop, 2000' areaname='AreaName'; run; ods pdf file="&mapdir./&rvar..pdf" notoc style=D3d; *** sasweb; options nodate; proc print data=temp&rvar label; by &rvar &rnamevar; id &rvar &rnamevar; var fipco areaname pop2k pop10 popjl13; format pop: comma9.; sum pop: ; sumby &rvar; title "®ion_name Regions"; run ; ods pdf close; %mend rept; %rept(rpc,rpcname,%str(Regional Planning Councils (RPCs))) ; %rept(dot,dotName,%str(MoDOT Transportation Planning Districts)); %rept(metroSA,cbsaname,%str(Metropolitan Statistical Areas (as of Feb 2013)),cbsaname); %rept(microSA,cbsaname,%str(Micropolitan Statistical Areas (as of Feb 2013)),cbsaname); %rept(aaa,aaaName,%str(Area Agencies on Aging)) ; %rept(ded_region,ded_regionName,%str(DED Economic Regions)); %rept(umx,umxName,%str(UM Extension Regions)); *---Here we generate the index.html page that will serve as the TOC for accessing these maps/reports---; proc format; value $regtype rpc='Regional Planning Council' ded_region='Econ Dev (DED)' metroSA='Metropolitan Statistical Area' microSA='micropolitan Statistical Area' aaa='Area Agency on Aging' dot='MoDOT Transportation District' umx='UM Extension Region'; run; data _null_; length regtype $16 Mapfile $10 Reptfile $16 regtypeLabel $40; retain regtypes 'rpc dot metroSA microSA aaa ded_region'; retain gmapsfxs ' 123456789'; file "&mapdir./index.html"; put '
| Region Type | Map File | Report File |
|---|---|---|
| ' regtypelabel ' | ' mapfile '' ' | ' reptfile ' |