<?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 summarize after break variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183098#M46634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would work, thank you. But it means that in some cases a variable whose value is only 2 bytes wide will take up 35 bytes of space. One of the variables to the left varies from 2 to 35 wide.&lt;/P&gt;&lt;P&gt;Good answer but in this case it won't work without having to do a lot of if/then coding.&lt;/P&gt;&lt;P&gt;I'd rather be able to easily emulate what rbreak after / summerize does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 17:51:01 GMT</pubDate>
    <dc:creator>kcskaiser</dc:creator>
    <dc:date>2015-01-14T17:51:01Z</dc:date>
    <item>
      <title>Proc Report summarize after break variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183096#M46632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm doing my best to make this understandable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS v9.2, E.G. v4.3&lt;/P&gt;&lt;P&gt;Data is sorted by id2.&lt;/P&gt;&lt;P&gt;Very simplified my code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data = logs3 nowd;&lt;/P&gt;&lt;P&gt;column id2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows=rowstot &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;define id2 / group noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;define rows / analysis;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;define rowstot / sum noprint;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;break after id2 / page;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;compute after id2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;line @40 rowstot comma12.;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;endcomp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want to add a summery line at the bottom of each of my groups. I can do this with a &amp;lt;compute after id2&amp;gt; block but then I can't guarentee the calculated variables (sum of row counts) used in the &amp;lt;line&amp;gt; will line up correctly with the column its reflecting. This is because rows to its left may be of different lengths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use &amp;lt;rbreak after / summerize skip dol&amp;gt; but I have no control over the look of the by variable (id2). And the by line is ugly it might say something like &amp;lt;id2=BI long name here&amp;gt; when all I really want it to say is &amp;lt;long name here&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I need to do to add the sum of my rows column to a new row broke at each id2 variable?&lt;/P&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183096#M46632</guid>
      <dc:creator>kcskaiser</dc:creator>
      <dc:date>2015-01-14T17:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report summarize after break variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183097#M46633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;This is because rows to its left may be of different lengths.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Use style overrides to specify an explicit length for the offending columns&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183097#M46633</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-14T17:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report summarize after break variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183098#M46634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would work, thank you. But it means that in some cases a variable whose value is only 2 bytes wide will take up 35 bytes of space. One of the variables to the left varies from 2 to 35 wide.&lt;/P&gt;&lt;P&gt;Good answer but in this case it won't work without having to do a lot of if/then coding.&lt;/P&gt;&lt;P&gt;I'd rather be able to easily emulate what rbreak after / summerize does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183098#M46634</guid>
      <dc:creator>kcskaiser</dc:creator>
      <dc:date>2015-01-14T17:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report summarize after break variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183099#M46635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; The issue you're running into is that the line @40 will only work in the LISTING destination. So if you are working in EG, essentially, the @40 is ignored by the default EG destination or by any ODS destination other than listing -- the side effect of this, is that using the LINE statement nothing "lines up" column for column because, the ODS output is written in a proportional spaced font.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RBREAK AFTER is used for a "grand total" that will only appear 1 place -- you can put it at the bottom of the report (after the last report row) with RBREAK AFTER. Or you can use RBREAK BEFORE to get it at the top of the report (before the first report row). The only circumstance where RBREAK after will give you multiple break lines on the report is if you have a BY statement in your code (which I didn't see in what you posted).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; But why are you writing your own value for ROWSTOT?&amp;nbsp; I would think that the simple SUMMARIZE option on your BREAK statement would work. (BREAK AFTER ID2/SUMMARIZE;) In fact, I don't actually get why you have ROWS and then use the ALIAS ROWSTOT unless you have WAY more complicated data. But the LINE @40 won't do what you want. I think that BREAK AFTER is a better choice for what you appear to be doing.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; You didn't post any data so I made some from SASHELP.CLASS. As you can see in the posted output. using SUMMARIZE on the BREAK gives me the same number under ROWS, ROWSTOT or in the LINE statement. I didn't bother to use NOPRINT because I wanted to show ALL the variables and it seemed more likely that your real data had more columns than just the 3 you showed, so I put NAME on the report. And because I put SubTotal and Grand Total on the summary lines, you can see which report row came from which statement. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data logs3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; length id2 $15;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; set sashelp.class;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; where age in (12, 13, 14);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; id2 = age;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; rows = height;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; ** make a lot of obs for each id2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; do i = 1 to 4;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title; footnote;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=logs3 nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; column id2 name rows rows=rowstot;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define id2 / group;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define name / group;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define rows / analysis f=comma12.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define rowstot / sum 'rowstot alias' f=comma12.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; break after id2 / page summarize;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; rbreak after /summarize;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute after id2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id2 = 'SubTotal';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line '----&amp;gt; value for rowstot is: ' rowstot comma12.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute after;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id2 = 'Grand Total';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11616iB0A3E83C02F32FD6/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="why_not_use_summarize_option.png" title="why_not_use_summarize_option.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 19:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183099#M46635</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-01-14T19:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report summarize after break variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183100#M46636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I removed the alias for rowstot&lt;/P&gt;&lt;P&gt;2) I removed the define for rowstot&lt;/P&gt;&lt;P&gt;3) I modified my compute after id2 block by removing any reference to rowstot&lt;/P&gt;&lt;P&gt;4) I added a: break after id2 / page summarize; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not know I could do step 4 until I tried it at your suggestion. I thought it had to be done in a rbreak, which didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 21:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-summarize-after-break-variable/m-p/183100#M46636</guid>
      <dc:creator>kcskaiser</dc:creator>
      <dc:date>2015-01-14T21:02:26Z</dc:date>
    </item>
  </channel>
</rss>

