<?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: Problem to get grand total using proc report in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4592#M1473</link>
    <description>You are probably running into this issue:&lt;BR /&gt;
&lt;A href="http://support.sas.com/faq/005/FAQ00581.html" target="_blank"&gt;http://support.sas.com/faq/005/FAQ00581.html&lt;/A&gt; where PROC REPORT does not summarize across BY groups. Every BY group is treated as a separate entity.&lt;BR /&gt;
 &lt;BR /&gt;
If you go back and look at this forum posting, &lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?threadID=1840&amp;amp;tstart=0" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?threadID=1840&amp;amp;tstart=0&lt;/A&gt;&lt;BR /&gt;
you will see that the examples that have BY group processing do NOT use the RBREAK statement.&lt;BR /&gt;
&lt;BR /&gt;
If you have an immediate need, then your only other choice is to contact Tech Support for further help. If you are having problems with code that's been posted, once you modify the code for your particular data, then Tech Support can help you figure out how to modify these code examples for your particular need, using your data. There are at least 3 ways that I can think of that you could use to get your final grand total without using BY group processing -- and still have your header text (like REGION = XXXXX) on/in the table(s).&lt;BR /&gt;
&lt;BR /&gt;
No BY group processing involved:&lt;BR /&gt;
1)  USE PAGE option on Break statement for the NOPRINT var + RBREAK After + COMPUTE BEFORE _PAGE_ + COMPUTE AFTER -- also will have to set some temporary variables and flags so you get the correct text string at the final grand total.&lt;BR /&gt;
2) USE RBREAK After + COMPUTE BEFORE NOPRINT var + Break Statement on the NOPRINT var (but without PAGE option) + COMPUTE AFTER &lt;BR /&gt;
3) Use RBREAK After + COMPUTE BEFORE NOPRINT var + with PAGE option on BREAK for NOPRINT var + COMPUTE AFTER&lt;BR /&gt;
&lt;BR /&gt;
 However, I am teaching class this week and my time to experiment with examples is limited. If you can't figure out the syntax from the documentation or by modifying previous examples, your best bet would be to seek help from Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
&lt;BR /&gt;
Good PROC REPORT help topics are entitled:&lt;BR /&gt;
Creating Detail and Summary Reports with the REPORT Procedure&lt;BR /&gt;
Overview: REPORT Procedure&lt;BR /&gt;
Concepts: REPORT Procedure&lt;BR /&gt;
How PROC REPORT Builds a Report</description>
    <pubDate>Thu, 06 Sep 2007 23:42:43 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2007-09-06T23:42:43Z</dc:date>
    <item>
      <title>Problem to get grand total using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4591#M1472</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I am not able to get grant totals for my report.&lt;BR /&gt;
for example:-&lt;BR /&gt;
My report looks like this&lt;BR /&gt;
&lt;BR /&gt;
Supplier: ABC&lt;BR /&gt;
Branch   GRN  Order_No Order_type Product_code      Date          Goods_value&lt;BR /&gt;
XYZ         1          001          R              123               05/09/07         1000&lt;BR /&gt;
                                                                                                   ----------&lt;BR /&gt;
  Total for ABC                                                                                1000&lt;BR /&gt;
&lt;BR /&gt;
Supplier: PQR&lt;BR /&gt;
Branch   GRN  Order_No Order_type Product_code      Date          Goods_value&lt;BR /&gt;
IJK        2          0012         R              124               05/09/07         2000&lt;BR /&gt;
                                                                                                 ----------&lt;BR /&gt;
  Total for PQR                                                                             2000&lt;BR /&gt;
                                                                                                ------------&lt;BR /&gt;
Total for ALL suppliers                                                                  3000&lt;BR /&gt;
&lt;BR /&gt;
I am not able to generate the above line for grand total for all suppliers.&lt;BR /&gt;
&lt;BR /&gt;
Code which i am using to generate my output is this&lt;BR /&gt;
&lt;BR /&gt;
proc report data=WORK.QUERY3051 nowd headskip split='*' spacing=1;&lt;BR /&gt;
by Cf_Su_Name ;&lt;BR /&gt;
title2  'SUPPLIER : #byval(Cf_Su_Name)      '    ;&lt;BR /&gt;
	column Cf_Su_Name Gb_Br_Name &lt;BR /&gt;
			Pi_In_Grnno Pi_In_Grn Pi_In_Orderno Pi_In_Ordtype Pi_In_Partno &lt;BR /&gt;
			Pi_In_Grndate Pi_In_Recqty Pi_In_Recgoods Pi_In_Recprice; &lt;BR /&gt;
	define Cf_Su_Name /group   noprint order=formatted width=25 ;&lt;BR /&gt;
	define Gb_Br_Name  / group  order=formatted width=25;&lt;BR /&gt;
&lt;BR /&gt;
	define Pi_In_Orderno / order width=6;&lt;BR /&gt;
	define Pi_In_Ordtype / 'Order*Type' 	flow width=6;&lt;BR /&gt;
	define Pi_In_Grndate / order width=10;&lt;BR /&gt;
	define Pi_In_Recqty / 'Quantity*Received' analysis SUM format=8.;&lt;BR /&gt;
	define Pi_In_Recgoods / 'Net*Goods*Value' SUM format=comma16.2;&lt;BR /&gt;
	define Pi_In_Recprice / 'Net*Purchase*Cost' SUM	format=comma16.2;&lt;BR /&gt;
	&lt;BR /&gt;
	*break after Gb_Br_Name / summarize OL skip; &lt;BR /&gt;
	break after Cf_Su_Name / summarize OL skip ; &lt;BR /&gt;
	*rbreak after / summarize;  &lt;BR /&gt;
	&lt;BR /&gt;
	 compute after Cf_Su_Name ;&lt;BR /&gt;
			Gb_Br_Name = ' Total for  ' || trim(Cf_Su_Name ) ;&lt;BR /&gt;
	 endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Can you modify this code to generate me the grant total of all suppliers.</description>
      <pubDate>Thu, 06 Sep 2007 20:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4591#M1472</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2007-09-06T20:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to get grand total using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4592#M1473</link>
      <description>You are probably running into this issue:&lt;BR /&gt;
&lt;A href="http://support.sas.com/faq/005/FAQ00581.html" target="_blank"&gt;http://support.sas.com/faq/005/FAQ00581.html&lt;/A&gt; where PROC REPORT does not summarize across BY groups. Every BY group is treated as a separate entity.&lt;BR /&gt;
 &lt;BR /&gt;
If you go back and look at this forum posting, &lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?threadID=1840&amp;amp;tstart=0" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?threadID=1840&amp;amp;tstart=0&lt;/A&gt;&lt;BR /&gt;
you will see that the examples that have BY group processing do NOT use the RBREAK statement.&lt;BR /&gt;
&lt;BR /&gt;
If you have an immediate need, then your only other choice is to contact Tech Support for further help. If you are having problems with code that's been posted, once you modify the code for your particular data, then Tech Support can help you figure out how to modify these code examples for your particular need, using your data. There are at least 3 ways that I can think of that you could use to get your final grand total without using BY group processing -- and still have your header text (like REGION = XXXXX) on/in the table(s).&lt;BR /&gt;
&lt;BR /&gt;
No BY group processing involved:&lt;BR /&gt;
1)  USE PAGE option on Break statement for the NOPRINT var + RBREAK After + COMPUTE BEFORE _PAGE_ + COMPUTE AFTER -- also will have to set some temporary variables and flags so you get the correct text string at the final grand total.&lt;BR /&gt;
2) USE RBREAK After + COMPUTE BEFORE NOPRINT var + Break Statement on the NOPRINT var (but without PAGE option) + COMPUTE AFTER &lt;BR /&gt;
3) Use RBREAK After + COMPUTE BEFORE NOPRINT var + with PAGE option on BREAK for NOPRINT var + COMPUTE AFTER&lt;BR /&gt;
&lt;BR /&gt;
 However, I am teaching class this week and my time to experiment with examples is limited. If you can't figure out the syntax from the documentation or by modifying previous examples, your best bet would be to seek help from Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
&lt;BR /&gt;
Good PROC REPORT help topics are entitled:&lt;BR /&gt;
Creating Detail and Summary Reports with the REPORT Procedure&lt;BR /&gt;
Overview: REPORT Procedure&lt;BR /&gt;
Concepts: REPORT Procedure&lt;BR /&gt;
How PROC REPORT Builds a Report</description>
      <pubDate>Thu, 06 Sep 2007 23:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4592#M1473</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-06T23:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to get grand total using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4593#M1474</link>
      <description>Can you give me an example or can you modify my code given in my posting to use one of 3 options.&lt;BR /&gt;
I am not able to get you how will I able to get grand total as well as supplier=xxxx&lt;BR /&gt;
on the top without using by statement.</description>
      <pubDate>Fri, 07 Sep 2007 07:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4593#M1474</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2007-09-07T07:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to get grand total using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4594#M1475</link>
      <description>Hi:&lt;BR /&gt;
  Usually, if I have a program in my folders, I can just cut and paste it in here. However, for this question, I'd have to modify several programs that were doing a lot of other stuff as well as what you want and the 3 programs I was thinking of were all using DIFFERENT data  -- so I'd have to swap out the data, too. Since I'm teaching this week, I don't have time to devote to the task.&lt;BR /&gt;
 &lt;BR /&gt;
However, the folks in Tech Support have lots of experience with PROC REPORT and their job is to help with urgent or immediate issues. I really suggest that you contact Tech Support for help:&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/contact/index.html" target="_blank"&gt;http://support.sas.com/techsup/contact/index.html&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 07 Sep 2007 13:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Problem-to-get-grand-total-using-proc-report/m-p/4594#M1475</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-07T13:35:07Z</dc:date>
    </item>
  </channel>
</rss>

