<?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 Pie Graph Explode in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61735#M2075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; When you're creating the mvar macro variable, the strip() function isn't doing what you think it is, and therefore the variable is padded with blanks, and then it's not matching when you try to use it later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than using the strip() function, you'll want to use&amp;nbsp; ...&amp;nbsp;&amp;nbsp; separated by ' '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example, trying the strip() which doesn't work, and then using separated by ' ' which does work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select strip(make) into :mvar from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select make into :mvar separated by ' ' from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on SASWare Ballot feedback, we've added a 'trimmed' option to to make this a little more intuitive in SAS 9.3&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select make into :mvar trimmed from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2011 12:37:20 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2011-09-08T12:37:20Z</dc:date>
    <item>
      <title>Pie Graph Explode</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61733#M2073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the explode option on a pie statement allow macro variables as its value? When the i place a hard-coded on the explode option it gives the correct display of the graph. However when i get the value on a &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anything wrong with the code below? Your help is much appreciated. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milton&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;select strip(column) into: mvar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;from lib.source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data=graph_src&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pie taxpayer / &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;&amp;nbsp;&amp;nbsp;sumvar=percentage&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;&amp;nbsp;&amp;nbsp;slice=arrow&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;&amp;nbsp;&amp;nbsp;value=inside&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;&amp;nbsp;&amp;nbsp;explode="&amp;amp;MVAR"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 05:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61733#M2073</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2011-09-08T05:38:11Z</dc:date>
    </item>
    <item>
      <title>Pie Graph Explode</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61734#M2074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Are you absolutely sure that your SQL step is creating &amp;amp;amp;mvar correctly??&amp;nbsp; Do you see the expected value in the log if you have&lt;/P&gt;&lt;P&gt;%PUT mvar is: &amp;amp;amp;mvar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...after the QUIT statement for PROC SQL??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 12:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61734#M2074</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-09-08T12:27:17Z</dc:date>
    </item>
    <item>
      <title>Pie Graph Explode</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61735#M2075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; When you're creating the mvar macro variable, the strip() function isn't doing what you think it is, and therefore the variable is padded with blanks, and then it's not matching when you try to use it later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than using the strip() function, you'll want to use&amp;nbsp; ...&amp;nbsp;&amp;nbsp; separated by ' '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example, trying the strip() which doesn't work, and then using separated by ' ' which does work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select strip(make) into :mvar from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select make into :mvar separated by ' ' from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on SASWare Ballot feedback, we've added a 'trimmed' option to to make this a little more intuitive in SAS 9.3&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foo as select unique make, count(*) as count&lt;BR /&gt;from sashelp.cars group by make;&lt;BR /&gt;select make into :mvar trimmed from foo having count=max(count);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gchart data=sashelp.cars;&lt;BR /&gt; pie make / type=freq&lt;BR /&gt;&amp;nbsp;&amp;nbsp; slice=arrow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value=inside&lt;BR /&gt;&amp;nbsp;&amp;nbsp; explode="&amp;amp;MVAR"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 12:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61735#M2075</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2011-09-08T12:37:20Z</dc:date>
    </item>
    <item>
      <title>Pie Graph Explode</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61736#M2076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The new TRIMMED option is a welcome enhancement.&amp;nbsp; It might be worth mentioning there are other ways to handle the quoted blanks produce by SQL INTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could simply reassign the macro variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let mvar=&amp;amp;mvar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use %unquote when referencing the macro variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;explode="%unquote(&amp;amp;mvar) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose unquote would be handy if processing an "array" of macro variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2011 15:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61736#M2076</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-09-08T15:25:06Z</dc:date>
    </item>
    <item>
      <title>Pie Graph Explode</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61737#M2077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it working now. Thanks for the help Dr. Allison!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milton&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 05:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Pie-Graph-Explode/m-p/61737#M2077</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2011-09-09T05:08:51Z</dc:date>
    </item>
  </channel>
</rss>

