%let name=maggot; filename odsout '.'; /* Mapping out the "maggot therapy" locations listed in ... http://www.ucihs.uci.edu/com/pathology/sherman/mdtists2.htm#UNITED The main purpose of this example is to catch peoples' attention! Although the maggot image in the background is somewhat revolting, it does get noticed, and grab your attention :) */ goptions reset=global; /* Don't include alaska & hawaii */ data states; set maps.states (where= ( fipstate(state) not in ('AK' 'HI' 'PR' 'DC') and (density < 3) ) ); /* 2-char abbreviation for the numeric state fips code */ st=fipstate(state); run; data maggot_anno; input zipcode citydesc $ 7-150; cards; 35294 Department of Justice Sciences, University of Alabama at Birmingham 90033 AC-USC Medical Center 93301 Mercy Hospital-Enterosomal Therapy Dept. 92658 Hoag Hospital 92270 Eisenhower Medical Center 92697 University of California 93101 Santa Barbara Cottage Hospital 93701 General and Vascular Surgery 32901 Osler Medical 33401 Psychological Institute of Performance, Inc. 60126 Dermatology & Dermatopathology 50022 Cass County Memorial Hospital 67214 Mid-Kansas Wound Specialists 66606 The Wound Clinic at Kansas Rehabilitation Hospital 42718 Taylor County Hospital 70506 Our Lady of Lourdes Regional Medical Center 21201 Maryland Institute for Emergency Medical Services 01655 Elliot Lach, MD 48071 Community Foot Care Clinic 64131 Vencor Hospital, Wound Care and Hyperbaric Medicine Program 59937 Gordon Medical Arts Center 68310 Robert F. Dorsey 87420 Northern Navajo Medical Center, Physical Therapy Dept. 87108 VA Medical Center, Physical Therapy Dept. 27408 Piedmont Orthopedics 73120 Mercy Health Center, Inpatient Physical Medicine 97420 Dermatology, Derm Surgery, and Dermatopathology 16365 Orthopaedic and Reconstructive Surgery 79106 Med Partners / Southwest Health Clinic 79606 Abilene Regional Medical Center 79410 Head and Neck Surgery 82604 Wyoming Medical Center, Dept of Physical Therapy ; run; /* Look up the longitude/latitude & cityname for this zipcode */ proc sql; create table maggot_anno as select maggot_anno.zipcode, maggot_anno.citydesc, zipcode.state, zipcode.city, zipcode.zip, -1*zipcode.x as longitude, zipcode.y as latitude from maggot_anno left join sashelp.zipcode on maggot_anno.zipcode=zipcode.zip; quit; run; /* Convert the degrees to radians */ data maggot_anno; set maggot_anno; x=atan(1)/45 * longitude; y=atan(1)/45 * latitude; run; data maggot_anno; length function style color $ 8 position $ 1 text $ 20 html $1024; retain xsys ysys '2' hsys '3' when 'a'; set maggot_anno; anno_flag=1; function='pie'; size=1; position='5'; rotate=360; color='red'; style='psolid'; line=1; /* This is the flyover text & drilldown */ html='title='||quote( trim(left(citydesc)) )|| ' href='||quote( 'http://www.ucihs.uci.edu/com/pathology/sherman/mdtists2.htm#'||trim(left(upcase(fipnamel(state)))) )||' '; output; run; /* Combine the map & annotation datasets, so you can project them together */ data combined; set states maggot_anno; run; /* project the map, and the annotation data set. When x/y are in longitude/latitude, they must be 'projected', or your map will look squished & backwards. */ proc gproject data=combined out=combined dupok; id state; run; /* Now, split the map & annotation apart again */ data states maggot_anno; set combined; if anno_flag=1 then output maggot_anno; else output states; run; GOPTIONS DEVICE=png; /* The url links in proc report were showing up as yellow, so I'm using an ods template to change them. There's *got* to be a better/easier way to do this... (borrowed this code from S0090163) */ proc template; define style styles.my_d3d; parent=styles.d3d; replace Document from Container "Abstract. Controls the various document bodies." / linkcolor = green visitedlinkcolor = blue; end; run; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" style=styles.my_d3d gtitle gfootnote ; goptions border; goptions iback='maggotmush.gif'; goptions xpixels=740 ypixels=580; goptions ftitle=zapfb ftext="arial" htitle=5pct htext=3.0pct; pattern1 v=s c=tan; title box=1 bcolor=tan c=black link="http://www.ucihs.uci.edu/com/pathology/sherman/home_pg.htm" "Maggot Therapy Locations"; proc gmap data=states map=states; id state; choro state / levels=1 anno=maggot_anno coutline=black nolegend des="" name="&name"; run; /* title "Here is the annotate dataset"; proc print data=maggot_anno; var zipcode city longitude latitude x y html; run; */ quit; ODS HTML CLOSE; ODS LISTING;