%let name=girl_scout_cookie_map; filename odsout '.'; /* Similar to this map: http://graphics.latimes.com/girl-scout-cookies/ Might update with info from this new map sometime: https://www.wideopeneats.com/girl-scouts-cookies-map/ */ data my_map; set mapsgfk.us_counties (where=(statecode not in ('AK' 'HI') and density<=3) drop=resolution); run; proc gproject data=my_map out=my_map latlong eastlong degrees dupok; id state county; run; data cookie_data; set mapsgfk.us_counties_attr (where=(statecode not in ('AK' 'HI'))); run; data cookie_data; set cookie_data; length cookie_maker $3; if statecode='WA' then cookie_maker='LBB'; if statecode='OR' then cookie_maker='LBB'; if statecode='ID' then cookie_maker='LBB'; if statecode='MT' then cookie_maker='LBB'; if statecode='WY' then cookie_maker='LBB'; if statecode='UT' then cookie_maker='LBB'; if statecode='CO' then cookie_maker='LBB'; if statecode='AZ' then cookie_maker='LBB'; if statecode='VT' then cookie_maker='LBB'; if statecode='NH' then cookie_maker='LBB'; if statecode='CT' then cookie_maker='LBB'; if statecode='WV' then cookie_maker='LBB'; if statecode='GA' then cookie_maker='LBB'; if statecode='MS' then cookie_maker='LBB'; if statecode='AR' then cookie_maker='LBB'; if statecode='LA' then cookie_maker='LBB'; if statecode='TN' then cookie_maker='LBB'; if statecode='CO' then cookie_maker='LBB'; if statecode='DE' then cookie_maker='LBB'; if statecode='ND' then cookie_maker='ABC'; if statecode='SD' then cookie_maker='ABC'; if statecode='ME' then cookie_maker='ABC'; if statecode='NE' then cookie_maker='ABC'; if statecode='KS' then cookie_maker='ABC'; if statecode='IA' then cookie_maker='ABC'; if statecode='RI' then cookie_maker='ABC'; if statecode='NV' then cookie_maker='ABC'; if statecode='NV' and county=7 then cookie_maker='LBB'; if statecode='CA' then cookie_maker='LBB'; if statecode='CA' and county in (27 71 111 29 51 65 59 83 79 53 107 31 19 69 39 87 49 35 63 109 11 113 47 43 115 101 77 99 67 9 17 61 3 5 91 57 ) then cookie_maker='ABC'; if statecode='FL' then cookie_maker='LBB'; if statecode='FL' and county in (97 9 127 69 95 117) then cookie_maker='ABC'; if statecode='TX' then cookie_maker='LBB'; if statecode='TX' and county in (111 205 43 377 141 229 3 165 61 215 109 243 389 371 443 105 301 475 359 117 501 445 479 283 295 211 483 87 369 17 79 219 311 279 291 201 495 135 505 427 247 131 489 261 47 273 249 297 25 175 355 409 39 321 245 71 123 285 391 469 167 57 239 481 157 383 173 461 103 227 335 329 317 353 441 59 133 351 241 97 497 439 367 251 217 337 77 503 75 197 69 425 221 363 237 487 485 429 417 115 33 421 195 357 125 253 151 341 9 23 233 393 305 303 419 403 347 225 361 199 455 5 457 405 373 407 339 471 473 415 447 375 381 189 155 207 275 65 179 437 129 11 433 169 263 45 191 107 153 269 101 345) then cookie_maker='ABC'; if statecode='SC' then cookie_maker='ABC'; if statecode='SC' and county in (51 43 91 53 25 31 15 89 29 35 5 49 19 75 13 27 9 17 41 67 33 69) then cookie_maker='LBB'; if statecode='MA' then cookie_maker='ABC'; if statecode='MA' and county in (3 11 15 13 27) then cookie_maker='LBB'; if statecode='NC' then cookie_maker='ABC'; if statecode='NC' and county in (179 167 7 123 25 119 159) then cookie_maker='LBB'; if statecode='AL' then cookie_maker='ABC'; if statecode='AL' and county in (125 91 119 107 75 93 63 65 105 77 33 59 57 127 79 83 71 49 89 103 133 43 73 117 21 7 121 115 37 27 111 29 15 19 55 95 9) then cookie_maker='LBB'; if statecode='OK' then cookie_maker='LBB'; if statecode='OK' and county in (25 139 7) then cookie_maker='ABC'; if statecode='NM' then cookie_maker='LBB'; if statecode='NM' and county in (23 29 25 15 35 17 51 13 27 5) then cookie_maker='ABC'; if statecode='OH' then cookie_maker='LBB'; if statecode='OH' and county in (87) then cookie_maker='ABC'; if statecode='WI' then cookie_maker='ABC'; if statecode='WI' and county in (71 117 15 39 89 95 109 93 13) then cookie_maker='LBB'; if statecode='MI' then cookie_maker='LBB'; if statecode='MI' and county in (21 27 109 43 71 53 131 61 33 83 13 97 95 153 41 103 3) then cookie_maker='ABC'; if statecode='IN' then cookie_maker='LBB'; if statecode='IN' and county in (39 129 51 141 99 3 183 85 163 173 17 49 103 169 69 179 1 87 151 113 33 147 125 83 27 37 101 123 131 149 91) then cookie_maker='ABC'; if statecode='IL' then cookie_maker='LBB'; if statecode='IL' and county in (1 67 113 179 57 109 167 137 131 187 149 9 19 183 71 161 169 171 61 107 75 147 115 39 125 17 129 53 117 135 21 143 173 139 203 105 41 95 73 11 175 123 99 155) then cookie_maker='ABC'; if statecode='KY' then cookie_maker='ABC'; if statecode='KY' and county in (177 103 41 211 179 27 105 215 229 155 217 1 57 29 93 163 83 35 7 143 75 39 145 227 183 171 9 111 3 225 139 223 185 101 55 47 219 157 221 169 87 85 213 59 33 233 99 141 31 123 61 107 149 91) then cookie_maker='LBB'; if statecode='MO' then cookie_maker='ABC'; if statecode='MO' and county in (189 99 199 45 113 163 71 219 186 187 173 127 183 111 103 1 121 205 197 171 221 211 115 137 123 93 55 157) then cookie_maker='LBB'; if statecode='MN' then cookie_maker='LBB'; if statecode='MN' and county in (137 75 31 71 61 7 5 111 27 107 11 155 167 69 57 21 23 67 135 77 1 35 93 171 119 89 17 115 29 87 125 113 151 149 51 41 153 97 159 121 145 9 65 95 141 ) then cookie_maker='ABC'; if statecode='PA' then cookie_maker='LBB'; if statecode='PA' and county in (91 11 29 95 77 107 25 17 45 101) then cookie_maker='ABC'; if statecode='MD' then cookie_maker='LBB'; if statecode='MD' and county in (5 13 27 25 510 3) then cookie_maker='ABC'; if statecode='NJ' then cookie_maker='ABC'; if statecode='NJ' and county in (27 29 25 37 19 41 35 13 31 3 39) then cookie_maker='LBB'; if statecode='VA' then cookie_maker='ABC'; if statecode='VA' and county in (169 191 167 25 81 59 27 51 195 105 173 185 21 171 69 107 153 800 1 139 73 187 61 175 43 103 193 179 159 550 810 183 93 33 97 101 127 111 117 53 41 135 7 85 149 147 37 49 145 87 181 177 75 760 199 95 99 735 36 57 700 133) then cookie_maker='LBB'; if statecode='NY' then cookie_maker='LBB'; if statecode='NY' and county in (13 73 37 63 29 9 121 51 55) then cookie_maker='ABC'; run; data cookie_data; set cookie_data; length cookie_maker_long $100; if cookie_maker='ABC' then cookie_maker_long='ABC Bakers'; if cookie_maker='LBB' then cookie_maker_long='Little Brownie Bakers'; run; data cookie_data; set cookie_data; length my_html $300; my_html= 'title='||quote( propcase(trim(left(idname)))||' county, '||trim(left(statecode))||'0d'x|| trim(left(cookie_maker_long))); run; proc gremove data=my_map out=anno_outline; by state; id county; run; data anno_outline; set anno_outline; by state segment notsorted; length function $8 color $8; color='white'; style='mempty'; when='a'; xsys='2'; ysys='2'; if first.segment then function='poly'; else function='polycont'; run; goptions device=png; goptions xpixels=950 ypixels=650; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Girl Scout Cookie Map") style=htmlblue; goptions gunit=pct htitle=5.5 ftitle="comic sans ms/bold" htext=4.0 ftext="comic sans ms/bold" ctext=gray22; legend1 label=none position=(bottom left) mode=share across=1 value=(c=gray55) offset=(3,4) shape=bar(.30in,.20in); pattern1 v=s c=A2db56a99; pattern2 v=s c=A99653399; title1 link='http://graphics.latimes.com/girl-scout-cookies/' ls=1.5 "Who Makes Your Girl Scout Cookies?"; proc gmap data=cookie_data map=my_map anno=anno_outline; id state county; choro cookie_maker_long / coutline=graybb legend=legend1 html=my_html des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;