<?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: Adding a percentage to a PRoc Report in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415929#M26749</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Report data=work.test;&lt;BR /&gt; by origin_cd;&lt;BR /&gt; Columns ORIGIN_CD TARGET_CD SP04 SP05 SP06 Total Total,(pctsum);&lt;BR /&gt; define Origin_CD / Display 'Origin';&lt;BR /&gt; Define Target_CD / DISPLAY 'Destination';&lt;BR /&gt; Define SP04 / DISPLAY 'SP2018_04' analysis SUM f=comma9.;&lt;BR /&gt; Define SP05 / DISPLAY 'SP2018_05' analysis SUM f=comma9.;&lt;BR /&gt; Define SP06 / DISPLAY 'SP2018_06' analysis SUM f=comma9.;&lt;BR /&gt; Define Total / DISPLAY 'Total' analysis sum;&lt;BR /&gt; Define pctsum / 'Percentage' format=percent6. width=8;&lt;BR /&gt; Rbreak after / summarize;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 04:12:45 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2017-11-24T04:12:45Z</dc:date>
    <item>
      <title>Adding a percentage to a PRoc Report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415925#M26747</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to add a percentage from the 'total' in a proc report. I have read a couple of submissions but not making sense to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks like 9apologies if the test data doesn't work)&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input ORIGIN_CD TARGET_CD SP04 SP05 SP06 Total;&lt;BR /&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;ABR&amp;nbsp;A 14 12&amp;nbsp;6 32&lt;BR /&gt;ABR&amp;nbsp;B 2&amp;nbsp;. 1&amp;nbsp;3&lt;BR /&gt;ABR&amp;nbsp;C .&amp;nbsp;2 1 3&lt;BR /&gt;ABR&amp;nbsp;D .&amp;nbsp;1 .&amp;nbsp;1&lt;BR /&gt;ABR&amp;nbsp;E .&amp;nbsp;. 1&amp;nbsp;1&lt;BR /&gt;ABR&amp;nbsp;F .&amp;nbsp;1 .&amp;nbsp;1&lt;BR /&gt;ABR&amp;nbsp;G 1 . 1&amp;nbsp;2&lt;BR /&gt;ABR&amp;nbsp;H .&amp;nbsp;1 .&amp;nbsp;1&lt;BR /&gt;ABR&amp;nbsp;I .&amp;nbsp;. 4&amp;nbsp;4&lt;BR /&gt;ABR&amp;nbsp;J 1&amp;nbsp;1 1&amp;nbsp;3&lt;BR /&gt;ABR&amp;nbsp;K 1&amp;nbsp;1 .&amp;nbsp;2&lt;BR /&gt;ABR&amp;nbsp;L .&amp;nbsp;. 1&amp;nbsp;1&lt;BR /&gt;ABR&amp;nbsp;M 1&amp;nbsp;3 9&amp;nbsp;13&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Report data=work.origindestbyqueuecalc;
	by origin_cd;
	Column ORIGIN_CD TARGET_CD SP04 SP05 SP06 Total ;
	define Origin_CD / Display 'Origin';
	Define Target_CD / DISPLAY 'Destination';
	Define SP04 / DISPLAY 'SP2018_04' analysis SUM f=comma9.;
	Define SP05 / DISPLAY 'SP2018_05' analysis SUM f=comma9.;
	Define SP06 / DISPLAY 'SP2018_06' analysis SUM f=comma9.;
	Define Total / DISPLAY 'Total' analysis sum;
	Rbreak after / summarize;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which gives me the output of&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output2.GIF" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16828iCBA1F15ADDF01E1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Output2.GIF" alt="Output2.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and I would like the output to look like the following&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output3.GIF" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16829i8310BAFECF2614B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Output3.GIF" alt="Output3.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 03:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415925#M26747</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-11-24T03:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a percentage to a PRoc Report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415929#M26749</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Report data=work.test;&lt;BR /&gt; by origin_cd;&lt;BR /&gt; Columns ORIGIN_CD TARGET_CD SP04 SP05 SP06 Total Total,(pctsum);&lt;BR /&gt; define Origin_CD / Display 'Origin';&lt;BR /&gt; Define Target_CD / DISPLAY 'Destination';&lt;BR /&gt; Define SP04 / DISPLAY 'SP2018_04' analysis SUM f=comma9.;&lt;BR /&gt; Define SP05 / DISPLAY 'SP2018_05' analysis SUM f=comma9.;&lt;BR /&gt; Define SP06 / DISPLAY 'SP2018_06' analysis SUM f=comma9.;&lt;BR /&gt; Define Total / DISPLAY 'Total' analysis sum;&lt;BR /&gt; Define pctsum / 'Percentage' format=percent6. width=8;&lt;BR /&gt; Rbreak after / summarize;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 04:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415929#M26749</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2017-11-24T04:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a percentage to a PRoc Report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415930#M26750</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42042"&gt;@stat_sas&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is exactly what I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 04:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-percentage-to-a-PRoc-Report/m-p/415930#M26750</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-11-24T04:21:29Z</dc:date>
    </item>
  </channel>
</rss>

