<?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 Report Grand Total in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494991#M21696</link>
    <description>&lt;P&gt;Hi: You do not need to pre-calculate the subtotal. For example, consider this report produced from 2 regions in SASHELP.SHOES:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="break_rbreak.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23220iDB3CE72F9C54E15F/image-size/large?v=v2&amp;amp;px=999" role="button" title="break_rbreak.png" alt="break_rbreak.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The BREAK statement produced the subtotal for each region and the RBREAK statement computed the GRAND TOTAL. The challenge if you pre-calculate the subtotals and put them in the data, is that then you have to turn around and exclude them from the grand total unless you pre-calculate the grand total too. It makes more sense to let PROC REPORT (or TABULATE) do it for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Wed, 12 Sep 2018 19:17:10 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-09-12T19:17:10Z</dc:date>
    <item>
      <title>Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494697#M21692</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sas report that has two sub totals named as 'TOTAL' (file attached). I would like to calculate the ''Grand Total' which I have colored in yellow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the following code to calculate the GRAND TOTAL but as expected it adds the sub totals as well&amp;nbsp;and shows the result 76 in place of 38.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;more code .......&lt;/P&gt;&lt;P&gt;rbreak after / SUMMARIZE style={color=yellow} ;&lt;BR /&gt;compute after;&lt;BR /&gt;Academics&amp;nbsp;= 'GRAND TOTAL';&lt;BR /&gt;endcomp;&lt;BR /&gt;run; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not created the "TOTAL"&amp;nbsp;in the Proc report. Rather I have created them in Proc Sql and then used the UNION function to add it to the table before I created the Proc report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence I am unsure of how to get the GRAND TOTAL which should select only the&amp;nbsp;observations&amp;nbsp;namely (leaving , new, old, continue, previous, Interna.)&amp;nbsp; to calculate the 'GRAND TOTAL'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest the correct procedure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 03:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494697#M21692</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-09-12T03:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494699#M21693</link>
      <description>I'd say the mismatch of approaches is the issue. Any reason not to do the same (add total via SQL) for the grand total and add it to the table? &lt;BR /&gt;&lt;BR /&gt;PROC TABULATE is a good option for automatic totals if needed. &lt;BR /&gt;&lt;BR /&gt;In general though, use either PROC REPORT/PRINT/TABULATE throughout or PROC MEANS/SQL to generate the totals &lt;BR /&gt;&lt;BR /&gt;PROC MEANS calculates summary statistics at multiple levels easily which may help here. Look at the WAYS and TYPES statements to see the different options.</description>
      <pubDate>Wed, 12 Sep 2018 03:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494699#M21693</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-12T03:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494702#M21694</link>
      <description>&lt;P&gt;Thank you for your suggestion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please provide a example of how to add selective observations using proc means as is in my case?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 03:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494702#M21694</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-09-12T03:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494712#M21695</link>
      <description>&lt;P&gt;If you provide sample data. What does your data look like to start with?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148556"&gt;@75063&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your suggestion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide a example of how to add selective observations using proc means as is in my case?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 04:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494712#M21695</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-12T04:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494991#M21696</link>
      <description>&lt;P&gt;Hi: You do not need to pre-calculate the subtotal. For example, consider this report produced from 2 regions in SASHELP.SHOES:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="break_rbreak.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23220iDB3CE72F9C54E15F/image-size/large?v=v2&amp;amp;px=999" role="button" title="break_rbreak.png" alt="break_rbreak.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The BREAK statement produced the subtotal for each region and the RBREAK statement computed the GRAND TOTAL. The challenge if you pre-calculate the subtotals and put them in the data, is that then you have to turn around and exclude them from the grand total unless you pre-calculate the grand total too. It makes more sense to let PROC REPORT (or TABULATE) do it for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 19:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/494991#M21696</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-09-12T19:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/495933#M21716</link>
      <description>&lt;P&gt;Thank you Cynthia for your explanation and advice. I&amp;nbsp;think proc&amp;nbsp;Report is a better and smoother way to carry out the operation in this case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rs&lt;/P&gt;</description>
      <pubDate>Sat, 15 Sep 2018 14:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/495933#M21716</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-09-15T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/495948#M21717</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148556"&gt;@75063&lt;/a&gt;&amp;nbsp;please mark Cynthia answer as correct, not your own.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Sep 2018 15:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/495948#M21717</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-15T15:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737107#M24989</link>
      <description>&lt;P&gt;I am not sure why the labels for "subtotal" and "grand total" cannot be shown in my excel output. Any idea what's going on?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gordon13267_1-1619469481351.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58706i86C0B80A1F3AC95D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gordon13267_1-1619469481351.png" alt="gordon13267_1-1619469481351.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 20:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737107#M24989</guid>
      <dc:creator>gordon13267</dc:creator>
      <dc:date>2021-04-26T20:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737363#M24990</link>
      <description>Hi:&lt;BR /&gt;  What code did you try? What does your COMPUTE block look like? Are your values for FTIC, Dual Credit and Transfer numeric or character variables? Does your code generate LOG messages? If so, what are the LOG messages?&lt;BR /&gt;&lt;BR /&gt;   In my example, dated 09/12/2018, you can see my COMPUTE blocks and resulting output. The only reasons I can think of for your labels not to work are some error in your code, some problem with understanding the order of how PROC REPORT processes the report row or some issue with the type (numeric or character) -- but without data or code, it would be just a guess.&lt;BR /&gt;Cynthia</description>
      <pubDate>Tue, 27 Apr 2021 18:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737363#M24990</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-04-27T18:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Grand Total</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737367#M24991</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you are correct. After correcting the report order, there is no problem at all. Thanks again,&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 18:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Grand-Total/m-p/737367#M24991</guid>
      <dc:creator>gordon13267</dc:creator>
      <dc:date>2021-04-27T18:29:46Z</dc:date>
    </item>
  </channel>
</rss>

