<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Transform Data by Zip Code into US Regions in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77715#M2875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to use Alpay's code and need to recreate this portion there's way to do that without using ranges:&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value $zipfmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '48001'-'48999' = 'Region 1'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '49000'-'49999' = 'Region 2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = 'Region 3';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is you currently have data in the form something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Region ZipCode&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48001&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; 28003&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 34564&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that sound correct? If so you can create a format then use Alpay's code a few days ago, June 7 rather than mess with an array. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2012 20:08:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-06-13T20:08:10Z</dc:date>
    <item>
      <title>Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77703#M2863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data set that is listed out by zip code as the mapping coordinate but I would like to group those zip codes into a small number of regions (say 5 or 10).&amp;nbsp; Is there a way to do this using the zipcodes or do I need to develop a shape file to define the regions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, my data is similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid #000000; width: 184px; height: 112px;" width="182"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Zip&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Region&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Count&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;South&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;South&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90003&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;South&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90004&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;West&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90005&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;East&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use the zip codes to define the Regions and then sum the counts to display on the map?&amp;nbsp; Or do I need to create something similar to the coordinates in the maps.us table to define regions?&amp;nbsp; Thank you in advance for any help provided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 22:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77703#M2863</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-06T22:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77704#M2864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the sashelp.zip file to merge the zips into county or states. If you want different regions you need to figure out a way to group them individually, thought I'd think county would be a good way to start (knowing very little about this b/c I'm Canadian). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 23:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77704#M2864</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-06-06T23:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77705#M2865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have zip code and regions defined in a file like sashelp.zipcode you can create a format and use it to summarize your counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zafer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;data zipregion;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input Zip&amp;nbsp;&amp;nbsp;&amp;nbsp; Region $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;90001 South&lt;/P&gt;&lt;P&gt;90002 South&lt;/P&gt;&lt;P&gt;90003 South&lt;/P&gt;&lt;P&gt;90004 West&lt;/P&gt;&lt;P&gt;90005 East&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data zipcount;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input Zip&amp;nbsp;&amp;nbsp;&amp;nbsp; Count;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;90001 50&lt;/P&gt;&lt;P&gt;90002 75&lt;/P&gt;&lt;P&gt;90003 60&lt;/P&gt;&lt;P&gt;90004 75&lt;/P&gt;&lt;P&gt;90005 100&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/* If you have zip codes and regions defined in a data set */&lt;/P&gt;&lt;P&gt;data zipfmt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set zipregion;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain fmtname 'zipfmt';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start = Zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label = Region;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep fmtname Start Label;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc format cntlin=zipfmt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc summary data=zipcount nway missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format Zip zipfmt.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=zipcount_summary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 07:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77705#M2865</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-07T07:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77706#M2866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I should have been more clear.&amp;nbsp; Once you have the data summarized by region, how can I link the zip codes with a map file, say sashelp.zipcode and only display regions rather than zip codes.&amp;nbsp; Basically I want to define my map parameter by zip code, but display region rather than zip code, using proc gmap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 17:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77706#M2866</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-11T17:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77707#M2867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I am trying to do is similar to what is done in this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/kb/24/902.html"&gt;http://support.sas.com/kb/24/902.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead of writing out all 40,000 zipcodes, could I just group them somehow so the regions are assigned by a region field that is related to a zip code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 18:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77707#M2867</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-11T18:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77708#M2868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't you just use the zipstate function (see &lt;A href="http://support.sas.com/kb/24/803.html" title="http://support.sas.com/kb/24/803.html"&gt;http://support.sas.com/kb/24/803.html&lt;/A&gt; ) and then do the region assignments as was done in the example that you showed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 18:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77708#M2868</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-06-11T18:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77709#M2869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some of my regions are not defined by states unfortunately.&amp;nbsp; California is split between two regions for example.&amp;nbsp; That is why I thought of defining my regions by zip code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 19:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77709#M2869</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-11T19:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77710#M2870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doesn't Art have the right idea here?&amp;nbsp; What if you were to use the code in the sample program, but change from ID STATE to ID ZIP?&amp;nbsp; Isn't that exactly what you need?&amp;nbsp; (You might have to sum up your COUNT variable separately.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 20:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77710#M2870</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-06-11T20:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77711#M2871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I unserstand it right, you want to drill down from region to zip codes and color it on a map and remove the inerior boundaries for regions. Do these regions have discontiguous areas?&lt;/P&gt;&lt;P&gt;You will probably need shape files for zip codes (www.census.gov).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 21:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77711#M2871</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-11T21:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77712#M2872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Download the following file from &lt;A href="http://www.census.gov" target="_blank"&gt;www.census.gov&lt;/A&gt; web site (&lt;A href="http://www.census.gov/cgi-bin/geo/shapefiles2010/layers.cgi" title="http://www.census.gov/cgi-bin/geo/shapefiles2010/layers.cgi"&gt;2010 TIGER/Line&amp;amp;reg; Shapefiles: &lt;/A&gt;)&lt;/P&gt;&lt;P&gt;2012 TIGER/Line Shapefiles: ZIP Code Tabulation Areas for Michigan.&lt;/P&gt;&lt;P&gt;You can download the shape files for other states as well and define your zip code to region format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value $zipfmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '48001'-'48999' = 'Region 1'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '49000'-'49999' = 'Region 2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = 'Region 3';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mapimport datafile="D:\Temp\Zip\tl_2010_26_zcta510.shp"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=mi;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table mi_1 as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select -1*x as x,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZCTA5CE10 as Zip,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Segment,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put(ZCTA5CE10,$zipfmt.) as Region&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from mi;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=mi_1;&lt;/P&gt;&lt;P&gt;by Region Zip Segment;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc gremove data=mi_1 out=mi_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by Region;&lt;/P&gt;&lt;P&gt;&amp;nbsp; id Zip Segment;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc gproject data=mi_2 out=mi_prj degrees;&lt;/P&gt;&lt;P&gt;id Region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;goptions device=png htext=3 gunit=pct cback=verylightmoderateyellow;&lt;/P&gt;&lt;P&gt;title;&lt;/P&gt;&lt;P&gt;proc gmap data=mi_prj map=mi_prj;&lt;/P&gt;&lt;P&gt;&amp;nbsp; id Region;&lt;/P&gt;&lt;P&gt;&amp;nbsp; choro Region / discrete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coutline=Black&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nolegend;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 07:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77712#M2872</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-12T07:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77713#M2873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here's a similar example to Alpay's, using a county map (which is shipped with SAS/Graph), rather than zip code maps - it plots the map at a couple of points along the way, so you can see how we're building up the final map:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_map; set maps.uscounty (where=(fipstate(state) in ('NC' 'VA')));&lt;BR /&gt;original_order=_n_;&lt;BR /&gt;statecode=fipstate(state);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=my_map map=my_map;&lt;BR /&gt;id state county;&lt;BR /&gt;choro state / discrete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new_map; set my_map;&lt;BR /&gt;if statecode='VA' then region='A';&lt;BR /&gt;if statecode='NC' then region='B';&lt;/P&gt;&lt;P&gt;/* let's say these 4 counties in NC are really in region 'A' (with Virginia) */&lt;BR /&gt;if statecode='NC' and county in (77 69 181 185) then region='A';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=new_map map=maps.uscounty;&lt;BR /&gt;id state county;&lt;BR /&gt;choro region;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=new_map out=new_map;&lt;BR /&gt;by region original_order;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gremove data=new_map out=new_map;&lt;BR /&gt;by region;&lt;BR /&gt;id state county;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gmap data=new_map map=new_map;&lt;BR /&gt;id region;&lt;BR /&gt;choro region;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 12:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77713#M2873</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2012-06-12T12:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77714#M2874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The methods that alpay and Robert listed work, I guess I'm just struggling with how to convert the 40k plus zip codes into an array.&amp;nbsp; Alpay's example assumes region include sequential zip codes, which mine do not.&amp;nbsp; Here is an output of a proc means to show the range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="261"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="4" height="47" width="261"&gt;Analysis Variable : ZIP The 5-digit ZIP Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="35" style="border-top: none;" width="54"&gt;Region&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;N&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="64"&gt;Minimum&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="79"&gt;Maximum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;5802&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;7002&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;61378&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;9786&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;544&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;88595&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region3&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;154&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;99501&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;99950&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region4&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;5191&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;19930&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;74966&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region5&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;7386&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1005&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;78962&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region6&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;4709&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;59001&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;99403&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region7&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1649&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;24314&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;49289&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region8&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1159&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;501&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;93599&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;Region9&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;5498&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;39426&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;96158&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert's example assumes that you only want to change a handful amount of zip or counties, rather then setting the region by a range of zip codes.&amp;nbsp; I ran a proc transpose to convert my data to be in columns with each row representing a region.&amp;nbsp; I'm thinking maybe I can create an array of each row, though some regions have nearly 10k records and I'm not sure what the limit would be.&amp;nbsp; That way I could use Robert's method to set my regions by the zipcodes in my data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 19:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77714#M2874</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-13T19:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77715#M2875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to use Alpay's code and need to recreate this portion there's way to do that without using ranges:&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value $zipfmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '48001'-'48999' = 'Region 1'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '49000'-'49999' = 'Region 2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = 'Region 3';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is you currently have data in the form something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Region ZipCode&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48001&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; 28003&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 34564&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that sound correct? If so you can create a format then use Alpay's code a few days ago, June 7 rather than mess with an array. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 20:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77715#M2875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-06-13T20:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77716#M2876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, but my regions don't contain continuous zip codes. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I can't do this:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc format;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value $zipfmt&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '07002'-'61378' = 'Region 1'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '00544'-'88595' = 'Region 2'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;because the regions would overlap.&amp;nbsp; That is why I was thinking of an array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 20:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77716#M2876</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-13T20:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77717#M2877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a format from your data set using proc format and specifying your format data set (cntlin option).&lt;/P&gt;&lt;P&gt;For further explanation please see the documentation for proc format in help files.&lt;/P&gt;&lt;P&gt;I have not tested the following code but it gives an idea as a starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data zipfile;&lt;/P&gt;&lt;P&gt;input Region ZipCode $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48001&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; 28003&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; 34564&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48002&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data zipfmt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set zipfile;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain zipfmt '$zipfmt';&lt;/P&gt;&lt;P&gt;&amp;nbsp; Start =Zipcode;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Label = Region;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keep fmtname Start Label;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc format cntlin=zipfmt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 20:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77717#M2877</guid>
      <dc:creator>Alpay</dc:creator>
      <dc:date>2012-06-13T20:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77718#M2878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see how this would work, but if I'm correct you would need data by zip code for this to work, correct?&amp;nbsp; I have data by my region label and I am trying to use a separate data set that links zip codes to my regions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 21:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77718#M2878</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-13T21:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77719#M2879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you don't have a mapping of zipcodes to regions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do, then merge the information together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 22:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77719#M2879</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-06-13T22:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77720#M2880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a mapping of zip codes to regions, but I have 9 regions and 40k zip codes, so my choro variable will be repeated 40k times.&amp;nbsp; My thought was to use the zip codes to create my regions on the map, then add the data by region, but I guess that won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My other idea was to try and concatenate all the zip codes into a string so that the format option would work.&amp;nbsp; However, one of my regions has nearly 10k zip codes, so at 5 digits a piece, it exceeds the maximum string length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this just won't work.&amp;nbsp; It sound like I need to work on getting data by zip code, rather than region.&amp;nbsp; Then maybe I can use the format option to create my regions and sum my data by region.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 15:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77720#M2880</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-14T15:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77721#M2881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... here is something similar to what you are trying to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;me ... take the counties in New York State and form new geographic areas (HSAs) based on a set of rules that assign counties to HSAs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you ... take zip codes in US and and form new geographic areas (regions) based on a set of rules that assign zip codes to regions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you have a map data set with zip code boundaries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will have to create a new map data set with regions and you do that with PROC GREMOVE (see below) ... then you could create a choropleth map that is shaded by region based on you response data set&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code started with a county-based map from the SAS MAPS library (maps.counties) and ends up with an HSA-based map ... 8 HSAs are shown instead of the 62 New York State counties&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this example is in a paper ... "The Basics of Map Creation with SAS/Graph" ... and you can get the paper plus all the examples at ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.albany.edu/~msz03/map_basics.zip" title="http://www.albany.edu/~msz03/map_basics.zip"&gt;http://www.albany.edu/~msz03/map_basics.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* rules for county to HSA conversion;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc format;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;value cou2hsa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;3, 9, 13, 29, 37, 63, 73, 121 = '1'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;15, 51, 55, 69, 97, 99, 101, 117, 123= '2'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;11, 23, 43, 45, 49, 53, 65, 67, 75, 89, 109 = '3'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;7, 17, 107 = '4'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;1, 19, 21, 25, 31, 33, 35, 39, 41, 57, 77, 83, 91, 93, 95, 113, 115 = '5'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;27, 71, 79, 87, 105, 111, 119 = '6'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;5, 47, 61, 81, 85 = '7'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;59, 103 = '8'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* assign new geographic designation (HSA) to each New York State county from maps.counties data set;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data hsatemp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;set maps.counties;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;where state eq 36 and density lt 6;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;hsa = put(county,cou2hsa.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* sort map data set in order by new geographic designation;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc sort data=hsatemp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;by hsa;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* eliminate county boundaries with HSA areas using PROC GREMOVE; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc gremove data=hsatemp out=hsamap;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;by hsa;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;id county;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* project the map;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc gproject data=hsamap out=hsaproj;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;id hsa;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* create a dummy response data set ... one observation per new area;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;create table hsa as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;select distinct hsa, 1 as var&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;from hsamap;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* draw the map;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;goptions reset=all ftext='calibri' htext=2 gunit=pct;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;pattern v=ms c=blue;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;proc gmap&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data=hsa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;map=hsaproj;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;id hsa;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;choro var / discrete coutline=white nolegend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;note ' HEALTH SERVICE AREAS'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;j=l ' AREAS FORMED FROM COUNTIES'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;j=l ' USING PROC GREMOVE';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11183i2EB21E99F3FE8C64/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="hsamap.png" title="hsamap.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77721#M2881</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-06-14T16:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Transform Data by Zip Code into US Regions</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77722#M2882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the first part to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value cou2hsa&lt;/P&gt;&lt;P&gt;99501, 99502, 99503, 99504, 99505, 99506, 99507, 99508, 99509, 99510, 99511, 99513, 99514, 99515, 99516, 99517, 99518, 99519, 99520, 99521, 99522, 99523, 99524, 99529, 99530, 99540, 99556, 99557, 99566, 99567, 99568, 99572, 99573, 99574, 99575, 99577, 99586, 99587, 99588, 99599, 99603, 99605, 99610, 99611, 99615, 99619, 99627, 99629, 99631, 99635, 99639, 99640, 99645, 99647, 99652, 99653, 99654, 99656, 99663, 99664, 99667, 99668, 99669, 99672, 99674, 99675, 99676, 99677, 99682, 99683, 99686, 99687, 99688, 99689, 99691, 99693, 99694, 99695, 99697, 99701, 99702, 99703, 99704, 99705, 99706, 99707, 99708, 99709, 99710, 99711, 99712, 99714, 99716, 99720, 99724, 99725, 99729, 99730, 99731, 99732, 99733, 99737, 99738, 99740, 99743, 99744, 99755, 99756, 99757, 99758, 99760, 99764, 99767, 99768, 99774, 99775, 99776, 99777, 99779, 99780, 99781, 99790, 99801, 99802, 99803, 99811, 99820, 99821, 99824, 99825, 99826, 99827, 99829, 99830, 99832, 99833, 99835, 99836, 99840, 99841, 99850, 99901, 99903, 99918, 99919, 99921, 99922, 99923, 99925, 99926, 99927, 99928, 99929, 99950 = 'Region1'&lt;/P&gt;&lt;P&gt;other = 'Other Regions';&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data hsatemp;&lt;/P&gt;&lt;P&gt;set sashelp.zipcode;&lt;/P&gt;&lt;P&gt;hsa = put(ZIP,cou2hsa.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That seems to work up until gproject, where I get this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: At least one value is out of range for polar radian coordinates. Data may already be projected.&lt;/P&gt;&lt;P&gt;ERROR: Expected range is (-3.141592654, 3.1415926536) for X and (-1.570796327, 1.5707963268) for Y.&lt;/P&gt;&lt;P&gt;ERROR: Actual range is (-176.658889, 171.062651) for X and (5.310246, 70.66976) for Y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem comes from the fact that all these examples use shapefiles whereas the sashelp.zipcode uses center of zip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 18:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Transform-Data-by-Zip-Code-into-US-Regions/m-p/77722#M2882</guid>
      <dc:creator>P5C768</dc:creator>
      <dc:date>2012-06-14T18:12:36Z</dc:date>
    </item>
  </channel>
</rss>

