<?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: proc sgmap - getting an error message when I try to use dattrmap to specify colors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sgmap-getting-an-error-message-when-I-try-to-use-dattrmap/m-p/915666#M360783</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First, when I ran a proc print of you dataset 'attrmap' the variable 'fillcolor' is only populated for the first row.&amp;nbsp; Double check that this dataset looks the way you want it to.&lt;/P&gt;&lt;P&gt;Next, double check the syntax you are using on both the proc sgmap and choromap statements.&amp;nbsp; It should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgmap mapdata= nc&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; plotdata= hospitals&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; maprespdata= county_pop dattrmap= attrmap ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; choromap&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;group / mapid=county lineattrs=(color=blue) id=county name='counties'&amp;nbsp;&lt;STRONG&gt; attrid= A;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maps are tricky so sometimes it helps to run each layer (choro, bubble) separately.&amp;nbsp; Once you are satisfied that each layer works, then run the entire code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 19:49:34 GMT</pubDate>
    <dc:creator>jeanleid</dc:creator>
    <dc:date>2024-02-12T19:49:34Z</dc:date>
    <item>
      <title>proc sgmap - getting an error message when I try to use dattrmap to specify colors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgmap-getting-an-error-message-when-I-try-to-use-dattrmap/m-p/914565#M360390</link>
      <description>&lt;P&gt;I'm trying to control the colors on a map - plotted using proc sgmap.&amp;nbsp; I keep getting an error when I try to use dattrmap to assign the colors, likely because I'm using SAS v9.4.&amp;nbsp; &amp;nbsp; Any suggestions on how to control the colors used in the map?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data attrmap;&lt;BR /&gt;input id $1 value $3-19 fillcolor $20-40;&lt;BR /&gt;datalines;&lt;BR /&gt;A Greater than 60 cx3182bd&lt;BR /&gt;A 31 - 60 cx6baed6&lt;BR /&gt;A 11 - 30 cx9ecae1&lt;BR /&gt;A 1 - 10 cxc6dbef&lt;BR /&gt;A 0 cxFFFFFF;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods graphics / border outputfmt=png;&lt;BR /&gt;title 'NC Counties with Cardiac Surgeries in 2022';&lt;BR /&gt;proc sgmap mapdata=nc maprespdata=county_pop plotdata=hospitals;* dattrmap=attrmap;&lt;BR /&gt;choromap group / mapid=county lineattrs=(color=blue) id=county name='counties' attrmap=A;&lt;BR /&gt;bubble x=long y=lat size=count / fillattrs=(color=yellow)&lt;BR /&gt;name='hospitals';* datalabel=county&lt;BR /&gt;datalabelattrs=(color=black&lt;BR /&gt;size=9&lt;BR /&gt;style=italic);&lt;BR /&gt;keylegend 'counties' / title='County Surgery Count';&lt;BR /&gt;keylegend 'hospitals' / title='Hospital';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods graphics / reset;&lt;BR /&gt;title;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error messages:&lt;/P&gt;&lt;P&gt;5816 proc sgmap mapdata=nc maprespdata=county_pop plotdata=hospitals dattrmap=attrmap;*&lt;BR /&gt;--------&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;5816! dattrvar=A;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DESCRIPTION, MAPDATA,&lt;BR /&gt;MAPRESPDATA, NOAUTOLEGEND, PLOTDATA.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;5817 choromap group / mapid=county lineattrs=(color=blue) id=county name='counties' attrmap=A;&lt;BR /&gt;-------&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, DENSITY, DISCRETE, ID,&lt;BR /&gt;LEGENDLABEL, LINEATTRS, MAPID, NAME, TRANSPARENCY.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 20:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgmap-getting-an-error-message-when-I-try-to-use-dattrmap/m-p/914565#M360390</guid>
      <dc:creator>sschiro</dc:creator>
      <dc:date>2024-02-05T20:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgmap - getting an error message when I try to use dattrmap to specify colors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgmap-getting-an-error-message-when-I-try-to-use-dattrmap/m-p/915666#M360783</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First, when I ran a proc print of you dataset 'attrmap' the variable 'fillcolor' is only populated for the first row.&amp;nbsp; Double check that this dataset looks the way you want it to.&lt;/P&gt;&lt;P&gt;Next, double check the syntax you are using on both the proc sgmap and choromap statements.&amp;nbsp; It should look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgmap mapdata= nc&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; plotdata= hospitals&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; maprespdata= county_pop dattrmap= attrmap ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; choromap&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;group / mapid=county lineattrs=(color=blue) id=county name='counties'&amp;nbsp;&lt;STRONG&gt; attrid= A;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maps are tricky so sometimes it helps to run each layer (choro, bubble) separately.&amp;nbsp; Once you are satisfied that each layer works, then run the entire code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 19:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgmap-getting-an-error-message-when-I-try-to-use-dattrmap/m-p/915666#M360783</guid>
      <dc:creator>jeanleid</dc:creator>
      <dc:date>2024-02-12T19:49:34Z</dc:date>
    </item>
  </channel>
</rss>

