<?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: RBREAK in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59008#M7064</link>
    <description>Hi:&lt;BR /&gt;
  As much as I love PROC REPORT, I'm tempted to give this one to PROC TABULATE to produce the report. The ability to calculate percentages is very straightforward with TABULATE and usually produces the percentage you want either with a keyword percentage (ROWPCTSUM, COLPCTSUM, etc) or with a demoninator definition &amp;amp;LT;denom&amp;amp;GT; specified in the TABLE statement. PROC REPORT will do the job, but it does require some extra coding above and beyond basic PROC REPORT coding.&lt;BR /&gt;
&lt;BR /&gt;
  The only thing that TAB does that takes some getting used to is that it does an automatic multiply by 100 for percentages, which means that you cannot use the SAS pre-defined percent format. But with a PICTURE format, you can fix that easily and get a % into your cells. For example, given the data shown above, the TABULATE code would be as shown below. The PROC FORMAT step is defining a PICTURE format for use in the TABLE statement &lt;B&gt;*f=pct.&lt;/B&gt; crossing, otherwise, the comma8 format will be used for all the other cells.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data getpct;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input stage $ x y z total;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
A 1 2 2 5&lt;BR /&gt;
B 3 6 9 18&lt;BR /&gt;
C 1 2 5 8&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                   &lt;BR /&gt;
proc format;&lt;BR /&gt;
  picture pct low-high='009.9%';&lt;BR /&gt;
run;&lt;BR /&gt;
                   &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\getpct.html' style=sasweb;&lt;BR /&gt;
proc tabulate data=getpct f=comma8.;&lt;BR /&gt;
  class stage;&lt;BR /&gt;
  var x y z total;&lt;BR /&gt;
  table stage  all*pctsum&lt;TOTAL&gt;*f=pct.,&lt;BR /&gt;
        x y z total / row=float;&lt;BR /&gt;
  keylabel sum=' '&lt;BR /&gt;
           pctsum = ' '&lt;BR /&gt;
           all='Percent';&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;/TOTAL&gt;</description>
    <pubDate>Tue, 28 Jul 2009 15:49:59 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-07-28T15:49:59Z</dc:date>
    <item>
      <title>RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59004#M7060</link>
      <description>HI all,&lt;BR /&gt;
This is my data set..........&lt;BR /&gt;
&lt;BR /&gt;
STAGE            X     Y      Z      TOTAL&lt;BR /&gt;
A                     1      2      2        5&lt;BR /&gt;
B                     3      6      9       18&lt;BR /&gt;
C                     1      2      5        8&lt;BR /&gt;
TOTAL             5    10      16      31&lt;BR /&gt;
&lt;BR /&gt;
By using rbreak in proc report we can get this 'TOTAL' row means we can summarize the data but instead of total i want percentage of data values with respect to total and with % sign along with it..Like..........&lt;BR /&gt;
&lt;BR /&gt;
TOTAL   16.1%  32.2%  51.6%  100%&lt;BR /&gt;
&lt;BR /&gt;
SO IS IT POSSIBLE?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for ur help...........</description>
      <pubDate>Mon, 27 Jul 2009 07:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59004#M7060</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-27T07:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59005#M7061</link>
      <description>Check out PROC REPORT's COMPUTE statement. Here's the doc: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000068725.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000068725.htm&lt;/A&gt;. Also you can use the "Search Forum" link to find the answers given for very similar questions on this forum. Here's one such example: &lt;A href="http://support.sas.com/forums/thread.jspa?messageID=18961䨑" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=18961䨑&lt;/A&gt;.&lt;BR /&gt;
&lt;BR /&gt;
To display the percentages with a % sign, use the PERCENT. format.</description>
      <pubDate>Mon, 27 Jul 2009 16:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59005#M7061</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2009-07-27T16:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59006#M7062</link>
      <description>Hi buddy,&lt;BR /&gt;
&lt;BR /&gt;
thanks for ur help,&lt;BR /&gt;
&lt;BR /&gt;
the examples which u have mentioned by that we can get the percentage in column but not in a row..I want to have the calculated percentage at the end of the dataset in a row...wat i hav done i hav preapred a new data set consisting of only one row to calculate the percentage..then i hav converted botth the datasets column into character format..after that using '||' i have attached % sign with the percenatge data set....and then i have appended both the datasets..but this is a long procedure..isnt there any simpler way?</description>
      <pubDate>Tue, 28 Jul 2009 06:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59006#M7062</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-28T06:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59007#M7063</link>
      <description>Use a COMPUTED column to compute the percentage. Use the FORMAT= option on the DEFINE statement of the column to associate the PERCENT. format with the column.</description>
      <pubDate>Tue, 28 Jul 2009 12:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59007#M7063</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2009-07-28T12:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59008#M7064</link>
      <description>Hi:&lt;BR /&gt;
  As much as I love PROC REPORT, I'm tempted to give this one to PROC TABULATE to produce the report. The ability to calculate percentages is very straightforward with TABULATE and usually produces the percentage you want either with a keyword percentage (ROWPCTSUM, COLPCTSUM, etc) or with a demoninator definition &amp;amp;LT;denom&amp;amp;GT; specified in the TABLE statement. PROC REPORT will do the job, but it does require some extra coding above and beyond basic PROC REPORT coding.&lt;BR /&gt;
&lt;BR /&gt;
  The only thing that TAB does that takes some getting used to is that it does an automatic multiply by 100 for percentages, which means that you cannot use the SAS pre-defined percent format. But with a PICTURE format, you can fix that easily and get a % into your cells. For example, given the data shown above, the TABULATE code would be as shown below. The PROC FORMAT step is defining a PICTURE format for use in the TABLE statement &lt;B&gt;*f=pct.&lt;/B&gt; crossing, otherwise, the comma8 format will be used for all the other cells.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data getpct;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input stage $ x y z total;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
A 1 2 2 5&lt;BR /&gt;
B 3 6 9 18&lt;BR /&gt;
C 1 2 5 8&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                   &lt;BR /&gt;
proc format;&lt;BR /&gt;
  picture pct low-high='009.9%';&lt;BR /&gt;
run;&lt;BR /&gt;
                   &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\getpct.html' style=sasweb;&lt;BR /&gt;
proc tabulate data=getpct f=comma8.;&lt;BR /&gt;
  class stage;&lt;BR /&gt;
  var x y z total;&lt;BR /&gt;
  table stage  all*pctsum&lt;TOTAL&gt;*f=pct.,&lt;BR /&gt;
        x y z total / row=float;&lt;BR /&gt;
  keylabel sum=' '&lt;BR /&gt;
           pctsum = ' '&lt;BR /&gt;
           all='Percent';&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;/TOTAL&gt;</description>
      <pubDate>Tue, 28 Jul 2009 15:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59008#M7064</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-07-28T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: RBREAK</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59009#M7065</link>
      <description>Thanks a lot Cynthia..U have solved my problem&lt;BR /&gt;
and thanks to u too tim</description>
      <pubDate>Thu, 30 Jul 2009 09:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/RBREAK/m-p/59009#M7065</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-30T09:34:39Z</dc:date>
    </item>
  </channel>
</rss>

