<?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: How to add frequency percentages to GPLOT HBAR output? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714106#M27263</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/362969"&gt;@SASplebe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have base SAS graphics (e.g. GPLOT, etc.) but not SAS/GRAPH.&amp;nbsp;&amp;nbsp; Apologies, I should have been clearer in that last sentence.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_008&amp;amp;docsetId=allprodsproc&amp;amp;docsetTarget=p1vzipzy6l8so0n1gbbh3ae63czb.htm&amp;amp;locale=en" target="_self"&gt;SAS/GRAPH&lt;/A&gt; is GPLOT + GCHART and that family of procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS GRAPHICS includes the SG family of graphics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SG graphics are supported in all the newer versions since 9.3 so that's what you should be using moving forward, not GCHART or GPLOT.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 22:30:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-01-25T22:30:22Z</dc:date>
    <item>
      <title>How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714068#M27247</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am trying to add statistics columns&amp;nbsp;to a GPLOT hbar chart.&amp;nbsp; In ODS using the code below I&amp;nbsp;can make a nice looking hbar chart using the following code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;HBAR TESTVAR / RESPONSE=COUNT CATEGORYORDER=RESPDESC &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;STAT=SUM DATALABELPOS=LEFT DATALABEL ;&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; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;XAXIS LABEL='MONTHLY TOTAL' ;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SAS example 1.png" style="width: 876px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53899i79782D540342F40C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS example 1.png" alt="SAS example 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can also get the need frequency statistics by a simple&amp;nbsp; PROC FREQ:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;PROC FREQ DATA=PLOT ORDER=FREQ NOPRINT ; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;TABLES TESTVAR/OUT=PRINT OUTCUM ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;WEIGHT COUNT;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation (2).png" style="width: 506px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53900i13FE9BDB164A0E67/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation (2).png" alt="Annotation (2).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But what I really want is to combine these two to make a chart/table like the one I created by cutting and pasting the above together (slightly different data):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation (3).png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53901i248EE01127A16720/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation (3).png" alt="Annotation (3).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Possible with GPLOT?&amp;nbsp; I do not have SAS Graphics.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 20:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714068#M27247</guid>
      <dc:creator>SASplebe</dc:creator>
      <dc:date>2021-01-25T20:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714070#M27248</link>
      <description>Are you sure you don't have SGPLOT? It's been included in Base for a while now so that would mean either you're on a supremely old version of SAS or using WPS or something similar.&lt;BR /&gt;&lt;BR /&gt;Use the following to see your version and licensing.&lt;BR /&gt;&lt;BR /&gt;proc product_status;run;</description>
      <pubDate>Mon, 25 Jan 2021 20:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714070#M27248</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T20:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714072#M27249</link>
      <description>&lt;P&gt;I have base SAS graphics (e.g. GPLOT, etc.) but not SAS/GRAPH.&amp;nbsp;&amp;nbsp; Apologies, I should have been clearer in that last sentence.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 21:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714072#M27249</guid>
      <dc:creator>SASplebe</dc:creator>
      <dc:date>2021-01-25T21:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714095#M27258</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/362969"&gt;@SASplebe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have base SAS graphics (e.g. GPLOT, etc.) but not SAS/GRAPH.&amp;nbsp;&amp;nbsp; Apologies, I should have been clearer in that last sentence.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Basically the rule is show a complete procedure or data step, from the first line through the Run statement.&lt;/P&gt;
&lt;P&gt;Sometimes people ask "why is value X not showing" and then after getting the entire code we find something like:&lt;/P&gt;
&lt;PRE&gt;Where somevar ne "X";&lt;/PRE&gt;
&lt;P&gt;which means they specifically excluded the value.&lt;/P&gt;
&lt;P&gt;Many statements interact and the graphic procedures may be more of that than others because you can overlay one graph on top of another and if the values are "not nice" one bit of the graph isn't seen at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if this gives you enough to get further:&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.class noprint;
  tables age /out=summary outcum;
run;

proc sgplot data=summary;
   HBAR age / RESPONSE=COUNT CATEGORYORDER=RESPDESC
    STAT=SUM DATALABELPOS=LEFT DATALABEL ;              
   XAXIS LABEL='MONTHLY TOTAL' ;    
   yaxistable count percent cum_freq cum_pct/ 
       location=inside position=right 
   ;
run; &lt;/PRE&gt;
&lt;P&gt;Note that I provided a data set you should have available to test code with and complete procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not really sure why you want count twice though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use LABEL Statements to change the text of the yaxistable labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 23:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714095#M27258</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-25T23:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714106#M27263</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/362969"&gt;@SASplebe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have base SAS graphics (e.g. GPLOT, etc.) but not SAS/GRAPH.&amp;nbsp;&amp;nbsp; Apologies, I should have been clearer in that last sentence.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_008&amp;amp;docsetId=allprodsproc&amp;amp;docsetTarget=p1vzipzy6l8so0n1gbbh3ae63czb.htm&amp;amp;locale=en" target="_self"&gt;SAS/GRAPH&lt;/A&gt; is GPLOT + GCHART and that family of procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS GRAPHICS includes the SG family of graphics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SG graphics are supported in all the newer versions since 9.3 so that's what you should be using moving forward, not GCHART or GPLOT.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714106#M27263</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T22:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714115#M27268</link>
      <description>Ballardw,&lt;BR /&gt;Thank you so much, once I saw your yaxistable statement the proverbial light bulb turned on. Besides adding that statement I had to move my PROC FREQ statement above the SGPLOT procedure. Complete working code is below. Note that I XX'd out some title info and changed variable names to remove identifiable data, though this has no effect on the code logic. Very happy with the result, thanks again.&lt;BR /&gt;&lt;BR /&gt;DATA PLOT;&lt;BR /&gt;%LET REP_VAL=1 ;&lt;BR /&gt;%LET YEAR_DT= %SYSFUNC(YEAR("&amp;amp;SYSDATE"D));&lt;BR /&gt;%LET PREVMTH= %SYSFUNC( PUTN( %SYSFUNC( DATE() )-10, MONNAME10. ));&lt;BR /&gt;SET PDB.APITOT;&lt;BR /&gt;REP_MTH=MONTH(DDD) ;&lt;BR /&gt;IF REP_MTH=&amp;amp;REP_VAL ;&lt;BR /&gt;ODS LISTING CLOSE;&lt;BR /&gt;ODS GRAPHICS ON/&lt;BR /&gt;MAXOBS=20000000&lt;BR /&gt;WIDTH=15.5IN&lt;BR /&gt;HEIGHT=25IN ;&lt;BR /&gt;ODS NOPTITLE;&lt;BR /&gt;ODS PDF FILE=OUTPDF NOTOC;&lt;BR /&gt;PROC FREQ DATA=PLOT ORDER=FREQ NOPRINT ;&lt;BR /&gt;TABLES TESTVAR/OUT=OUTPUT OUTCUM;&lt;BR /&gt;WEIGHT COUNT;&lt;BR /&gt;PROC SGPLOT DATA=OUTPUT;&lt;BR /&gt;HBAR TESTVAR / RESPONSE=COUNT CATEGORYORDER=RESPDESC&lt;BR /&gt;DATALABELATTRS=(SIZE=6PT COLOR=BLUE)&lt;BR /&gt;STAT=SUM DATALABELPOS=LEFT DATALABEL ;&lt;BR /&gt;YAXIS LABEL='SERVICE NAME'&lt;BR /&gt;VALUEATTRS=(COLOR=GREEN SIZE=8PT) ;&lt;BR /&gt;XAXIS LABEL='API MONTHLY TOTAL'&lt;BR /&gt;VALUEATTRS=(COLOR=GREEN SIZE=10PT) ;&lt;BR /&gt;YAXISTABLE PERCENT CUM_FREQ CUM_PCT/&lt;BR /&gt;LOCATION=INSIDE POSITION=RIGHT ;&lt;BR /&gt;TITLE "XXXXXXXX MONTHLY SUMMARY" ;&lt;BR /&gt;TITLE2 "TOTAL BY XXXX XXXX PRODUCTION PLEX";&lt;BR /&gt;TITLE3 "&amp;amp;PREVMTH &amp;amp;YEAR_DT" ;&lt;BR /&gt;TITLE4 "DATA SOURCE: XXXXXXX RECORDS" ;&lt;BR /&gt;FORMAT COUNT CUM_FREQ COMMA12. PERCENT CUM_PCT 5.2 ;&lt;BR /&gt;LABEL&lt;BR /&gt;PERCENT='PERCENT OF TOTAL'&lt;BR /&gt;CUM_FREQ='CUMULATIVE FREQUENCY' ;&lt;BR /&gt;RUN ;&lt;BR /&gt;ODS PDF CLOSE ;&lt;BR /&gt;ODS LISTING ;</description>
      <pubDate>Mon, 25 Jan 2021 22:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714115#M27268</guid>
      <dc:creator>SASplebe</dc:creator>
      <dc:date>2021-01-25T22:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714118#M27269</link>
      <description>&lt;P&gt;Here is the report output:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation (4).png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53903i84DD00959931808C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation (4).png" alt="Annotation (4).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714118#M27269</guid>
      <dc:creator>SASplebe</dc:creator>
      <dc:date>2021-01-25T22:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add frequency percentages to GPLOT HBAR output?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714269#M27279</link>
      <description>&lt;P&gt;Reeza, you are correct.&amp;nbsp; My question/problem had to do with SGPLOT - doh!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 14:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-frequency-percentages-to-GPLOT-HBAR-output/m-p/714269#M27279</guid>
      <dc:creator>SASplebe</dc:creator>
      <dc:date>2021-01-26T14:21:52Z</dc:date>
    </item>
  </channel>
</rss>

