<?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 GCHART -- using row totals within groups in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-using-row-totals-within-groups/m-p/157234#M5895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I had done my due diligence prior to posting this but apparently, I hadn't been thorough enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I discovered that the option "g100" exists within gchart, but only if a group is specified (which makes perfect sense). My code now looks like the following &amp;amp; I can write a simpler macro for it now that I cut out proc freq as the middleman:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=a.yc_final_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar q4 / discrete noframe&lt;/P&gt;&lt;P&gt;&amp;nbsp; type=PCT inside=FREQ outside=PCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; width=&amp;amp;width gspace=&amp;amp;gspace&lt;/P&gt;&lt;P&gt;&amp;nbsp; raxis=axis1 maxis=axis2 gaxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp; patternID=group group=gender &lt;STRONG&gt;g100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; legend;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(As a side note, I used a macro that tailors the bar widths and spaces in between them.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2014 19:31:06 GMT</pubDate>
    <dc:creator>emcee825</dc:creator>
    <dc:date>2014-01-30T19:31:06Z</dc:date>
    <item>
      <title>PROC GCHART -- using row totals within groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-using-row-totals-within-groups/m-p/157233#M5894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use the row totals within groups for the percentages in proc gchart. I did find this bit of code that works spectacularly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=&amp;amp;dsn;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table q4*q606 /out=gd outpct noprint;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=gd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar q4 / patternID=group group=q606&lt;/P&gt;&lt;P&gt;&amp;nbsp; freq=pct_row&lt;/P&gt;&lt;P&gt;&amp;nbsp; discrete noframe&lt;/P&gt;&lt;P&gt;&amp;nbsp; outside=freq inside=count&lt;/P&gt;&lt;P&gt;&amp;nbsp; width=&amp;amp;width gspace=&amp;amp;gspace&lt;/P&gt;&lt;P&gt;&amp;nbsp; raxis=axis1 maxis=axis2 gaxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp; legend;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where q4 ne . and q606 ne .;&lt;/P&gt;&lt;P&gt;run; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, given that I have a lot of variables to go through like this, I wrote the following macro and though I understand why I'm getting the error that _all_ doesn't exist in the gd dataset, I'm not sure how to go about resolving that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro graphsnum(dsn,dsn3,var,covar);&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc freq data=&amp;amp;dsn;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table &amp;amp;var*&amp;amp;covar/ out=&amp;amp;dsn3 outpct noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc gchart data=&amp;amp;dsn3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar &amp;amp;var / patternID=group group=&amp;amp;covar&lt;/P&gt;&lt;P&gt;&amp;nbsp; freq=pct_row&amp;nbsp; outside=FREQ&lt;/P&gt;&lt;P&gt;&amp;nbsp; discrete noframe&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; width=&amp;amp;width gspace=&amp;amp;gspace&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; raxis=axis1 maxis=axis2 gaxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp; legend;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where &amp;amp;var ne . and &amp;amp;covar ne . and &amp;amp;covar ne 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run; quit;&lt;/P&gt;&lt;P&gt;%mend graphsnum;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%graphsnum(&amp;amp;dsn,&amp;amp;dsn3,_all_,gender);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sort of insight would be appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 17:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-using-row-totals-within-groups/m-p/157233#M5894</guid>
      <dc:creator>emcee825</dc:creator>
      <dc:date>2014-01-30T17:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GCHART -- using row totals within groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-using-row-totals-within-groups/m-p/157234#M5895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I had done my due diligence prior to posting this but apparently, I hadn't been thorough enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I discovered that the option "g100" exists within gchart, but only if a group is specified (which makes perfect sense). My code now looks like the following &amp;amp; I can write a simpler macro for it now that I cut out proc freq as the middleman:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=a.yc_final_2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar q4 / discrete noframe&lt;/P&gt;&lt;P&gt;&amp;nbsp; type=PCT inside=FREQ outside=PCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; width=&amp;amp;width gspace=&amp;amp;gspace&lt;/P&gt;&lt;P&gt;&amp;nbsp; raxis=axis1 maxis=axis2 gaxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp; patternID=group group=gender &lt;STRONG&gt;g100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; legend;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(As a side note, I used a macro that tailors the bar widths and spaces in between them.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 19:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-using-row-totals-within-groups/m-p/157234#M5895</guid>
      <dc:creator>emcee825</dc:creator>
      <dc:date>2014-01-30T19:31:06Z</dc:date>
    </item>
  </channel>
</rss>

