<?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: Question on proc report about summarizing data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74689#M21692</link>
    <description>Hi: &lt;BR /&gt;
  A followup...PROC REPORT is doing exactly what you tell it to do. If you compare the output for R=R1 versus R=R3, you will see that you are getting exactly the same output for both groups. PROC REPORT does not care whether the group has 1 detail row or 1000 detail rows. See the annotated output below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  r   x  y           z&lt;BR /&gt;
  r1  a  a1          1   &amp;lt;-- detail line for a1 X=a&lt;BR /&gt;
         a2          1   &amp;lt;-- detail line for a2 X=a&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1  a              2   &amp;lt;-- break after X=a&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
      b  a1          1   &amp;lt;-- detail line for a1 X=b&lt;BR /&gt;
         a2          1   &amp;lt;-- detail line for a2 X=b&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1  b              2   &amp;lt;-- break after X=b&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r1                 4   &amp;lt;-- break after R&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
             &lt;BR /&gt;
                       &lt;BR /&gt;
                        &lt;BR /&gt;
  r3  e  e1          1   &amp;lt;-- detail line for e1 X=e&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r3  e              1   &amp;lt;-- break after X=e&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r3                 1   &amp;lt;-- break after R&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
&lt;BR /&gt;
             =========&lt;BR /&gt;
                    11   &amp;lt;-- summary from RBREAK statement&lt;BR /&gt;
             =========&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                          &lt;BR /&gt;
As you can see, when R=R1, there are detail lines and summary lines, placed by the BREAK AFTER X and BREAK AFTER R. And with R=R3, even though you only have 1 detail line, you see the detail line, followed by the same summary lines which were produced for R=R1 (or R=R2 -- R2 not shown here to save space).&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT will not treat the group for R3 any differently than it treats the groups for R1 or R2.  So, PROC REPORT is giving you the only results that it can give you -- expecting anything different from PROC REPORT is unrealistic and contrary to the way that PROC REPORT has always worked.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Sun, 26 Sep 2010 18:38:19 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-09-26T18:38:19Z</dc:date>
    <item>
      <title>Question on proc report about summarizing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74687#M21690</link>
      <description>Hi Dear,&lt;BR /&gt;
Here is my coding:&lt;BR /&gt;
data temp;&lt;BR /&gt;
input r $2. x $1. y $2. z  1.;&lt;BR /&gt;
cards;&lt;BR /&gt;
r1aa11&lt;BR /&gt;
r1aa21&lt;BR /&gt;
r1ba11&lt;BR /&gt;
r1ba21&lt;BR /&gt;
r2ca11&lt;BR /&gt;
r2ca22&lt;BR /&gt;
r2da11&lt;BR /&gt;
r2da22&lt;BR /&gt;
r3ee11&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc report data=temp nowd nocenter;&lt;BR /&gt;
column  r x y z;&lt;BR /&gt;
define r / group;&lt;BR /&gt;
define x / group;&lt;BR /&gt;
define y / 'y';&lt;BR /&gt;
define z / analysis;&lt;BR /&gt;
&lt;BR /&gt;
break after x/summarize DOL DUL ;&lt;BR /&gt;
break after r /summarize DOL DUL ;&lt;BR /&gt;
rbreak after / summarize DOL DUL ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
How do I get the expeced below output:&lt;BR /&gt;
&lt;BR /&gt;
 r     x  y           z&lt;BR /&gt;
  r1  a  a1          1&lt;BR /&gt;
          a2          1&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1  a              2&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
       b  a1          1&lt;BR /&gt;
           a2          1&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1    b              2&lt;BR /&gt;
  ==   =      =========&lt;BR /&gt;
  ==           =========&lt;BR /&gt;
  r1                 4&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r2  c  a1          1&lt;BR /&gt;
          a2          2&lt;BR /&gt;
  ==     =      =========&lt;BR /&gt;
  r2       c              3&lt;BR /&gt;
  ==     =      =========&lt;BR /&gt;
      d  a1          1&lt;BR /&gt;
          a2          2&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r2    d              3&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==          =========&lt;BR /&gt;
  r2                 6&lt;BR /&gt;
  ==          =========&lt;BR /&gt;
  r3  e  e1          1&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
             =========&lt;BR /&gt;
                    11&lt;BR /&gt;
             =========&lt;BR /&gt;
&lt;BR /&gt;
but I am getting the below&lt;BR /&gt;
&lt;BR /&gt;
  r   x  y           z&lt;BR /&gt;
  r1  a  a1          1&lt;BR /&gt;
           a2          1&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1    a              2&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
      b  a1          1&lt;BR /&gt;
          a2          1&lt;BR /&gt;
  ==    =      =========&lt;BR /&gt;
  r1     b              2&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r1                 4&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r2  c  a1          1&lt;BR /&gt;
           a2          2&lt;BR /&gt;
  ==     =      =========&lt;BR /&gt;
  r2      c              3&lt;BR /&gt;
  ==     =      =========&lt;BR /&gt;
      d  a1          1&lt;BR /&gt;
         a2          2&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r2  d              3&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r2                 6&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r3   e   e1          1&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r3  e              1&lt;BR /&gt;
  ==  =     =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r3                 1&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
                =========&lt;BR /&gt;
                    11&lt;BR /&gt;
                 =========&lt;BR /&gt;
&lt;BR /&gt;
I don't want repeat r3 three times. I need this to appear only one time in the report&lt;BR /&gt;
Thanks so much for help in advance.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Inp</description>
      <pubDate>Sat, 25 Sep 2010 02:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74687#M21690</guid>
      <dc:creator>Inp</dc:creator>
      <dc:date>2010-09-25T02:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Question on proc report about summarizing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74688#M21691</link>
      <description>Hi &lt;BR /&gt;
Even though R3 only has one row you have asked for multiple summaries with the BREAK statement for X and R. PROC REPORT summarizes EVERY group, no matter whether there is one observation in a group or 1000 observations in a group ( as described in the doc)&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473623.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473623.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Are you seeing any warning messages in the Log???&lt;BR /&gt;
&lt;BR /&gt;
What is the usage of Y variable??? DISPLAY, ORDER or GROUP??&lt;BR /&gt;
&lt;BR /&gt;
You may want PROC report to perform processing that it is unable to perform. &lt;BR /&gt;
&lt;BR /&gt;
Cynthia</description>
      <pubDate>Sat, 25 Sep 2010 14:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74688#M21691</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-25T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Question on proc report about summarizing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74689#M21692</link>
      <description>Hi: &lt;BR /&gt;
  A followup...PROC REPORT is doing exactly what you tell it to do. If you compare the output for R=R1 versus R=R3, you will see that you are getting exactly the same output for both groups. PROC REPORT does not care whether the group has 1 detail row or 1000 detail rows. See the annotated output below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  r   x  y           z&lt;BR /&gt;
  r1  a  a1          1   &amp;lt;-- detail line for a1 X=a&lt;BR /&gt;
         a2          1   &amp;lt;-- detail line for a2 X=a&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1  a              2   &amp;lt;-- break after X=a&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
      b  a1          1   &amp;lt;-- detail line for a1 X=b&lt;BR /&gt;
         a2          1   &amp;lt;-- detail line for a2 X=b&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r1  b              2   &amp;lt;-- break after X=b&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r1                 4   &amp;lt;-- break after R&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
             &lt;BR /&gt;
                       &lt;BR /&gt;
                        &lt;BR /&gt;
  r3  e  e1          1   &amp;lt;-- detail line for e1 X=e&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  r3  e              1   &amp;lt;-- break after X=e&lt;BR /&gt;
  ==  =      =========&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
  r3                 1   &amp;lt;-- break after R&lt;BR /&gt;
  ==         =========&lt;BR /&gt;
&lt;BR /&gt;
             =========&lt;BR /&gt;
                    11   &amp;lt;-- summary from RBREAK statement&lt;BR /&gt;
             =========&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                          &lt;BR /&gt;
As you can see, when R=R1, there are detail lines and summary lines, placed by the BREAK AFTER X and BREAK AFTER R. And with R=R3, even though you only have 1 detail line, you see the detail line, followed by the same summary lines which were produced for R=R1 (or R=R2 -- R2 not shown here to save space).&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT will not treat the group for R3 any differently than it treats the groups for R1 or R2.  So, PROC REPORT is giving you the only results that it can give you -- expecting anything different from PROC REPORT is unrealistic and contrary to the way that PROC REPORT has always worked.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Sun, 26 Sep 2010 18:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-on-proc-report-about-summarizing-data/m-p/74689#M21692</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-26T18:38:19Z</dc:date>
    </item>
  </channel>
</rss>

