<?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 dynamic sub total heading in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217538#M14238</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; Sorry, I was offline for a while. Here's the code that created the screen shot for SASHELP.SHOES. When I made the 2 "extra" variables in the COMPUTE block, note how I made the LENGTH= big enough to hold my whole string: (length=55). That's because the string that you assign at the break (as shown for PRODUCT column) will get truncated to the length of the variable. And, as you can see&amp;nbsp; for PRODUCT, the string that I try to assign gets "cut off" and so, doesn't look right. I am guessing that your variable is not wide enough to hold the whole TOTAL string that you are trying to concatenate together.&lt;/P&gt;&lt;P&gt;&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;** sashelp.shoes has multiple obs per product/region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\customize_break_diff_ways.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;PROC REPORT DATA=sashelp.shoes nowd NOCENTER;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where region in ('Asia', 'Pacific', 'Canada');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title 'Different Example';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; COLUMN&amp;nbsp; product display_product1 display_product2 region n sales inventory returns;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define product / group /* noprint */;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define display_product1 / computed;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define display_product2 / computed;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define region / 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 n / 'Count';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define sales / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define inventory / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define returns / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** will use HOLDPROD for DISPLAY_PRODUCT2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute before product;&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;&amp;nbsp; length holdprod $55;&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;&amp;nbsp; holdprod = product;&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; break after product / summarize;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute after product;&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; product = catx(' ','Average for:', product);&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 ' ';&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute display_product1 / character length=55;&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; display_product1 = product;&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; if upcase(_break_) = 'PRODUCT' then &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_product1=catx(' ','Average and Count for:', product);&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute display_product2 / character length=55;&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; if product = ' ' then display_product2=holdprod;&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; else display_product2 = product;&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; if upcase(_break_) = 'PRODUCT' then &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_product2=catx(' ','Average and Count for:', product);&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;RUN;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 23:02:34 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2015-05-26T23:02:34Z</dc:date>
    <item>
      <title>proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217530#M14230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder how I can have the name of the actual total-ing species in the sub heading instead of writing "total SPECIES".&lt;/P&gt;&lt;P&gt;i.e. Total Pigs, Total Horses&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; COMPUTE CATEGORIE ;&lt;/P&gt;&lt;P&gt; IF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _BREAK_ = 'SPECIES' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPECIES ='total SPECIES';&lt;/P&gt;&lt;P&gt; ELSE IF _BREAK_ ='ResultCat' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ResultCat = 'total R.Cat';&lt;/P&gt;&lt;P&gt; ELSE IF _BREAK_ ='CATEGORIE' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CATEGORIE = 'total Cat.';&lt;/P&gt;&lt;P&gt; ENDCOMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A similar problem has been encountered here:&lt;/P&gt;&lt;P&gt;&lt;A class="" href="https://communities.sas.com/message/150738#150738"&gt;https://communities.sas.com/message/150738&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried CATEGORIE = 'Sum of'||trim(CATEGORIE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..but that did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 13:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217530#M14230</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-05-20T13:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217531#M14231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally I would do calculations etc. and set the dataset up as you want to see it before the proc report call.&amp;nbsp; Then you can put whatever you want in any place you want, i.e. full control.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 14:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217531#M14231</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-20T14:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217532#M14232</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; Did you run the code shown in the posting you referenced. It still works in PROC REPORT. So I don't know why you are having issues. I&amp;nbsp; generally do this for the BREAK statement, since comparisons are case sensitive and RESULTCAT is not the same as ResultCat or resultcat:&lt;/P&gt;&lt;P&gt;if upcase(_break_) = 'RESULTCAT' then ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, in class and SAS machine not on internet and machine on internet doesn't have SAS. So no nice pictures..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 18:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217532#M14232</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-20T18:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217533#M14233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your code but wanted to display a character variable like Name. The below version does not work anymore. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC REPORT DATA=SASHELP.CLASS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nowd NOCENTER;&lt;/P&gt;&lt;P&gt;COLUMN&amp;nbsp; AGE display_age SEX NAME&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;DEFINE AGE / ORDER FORMAT= BEST9. /* NOPRINT */;&lt;/P&gt;&lt;P&gt;define display_age / computed 'Name' right&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)={just=r};&lt;/P&gt;&lt;P&gt;DEFINE SEX / ORDER FORMAT= $1. ;&lt;/P&gt;&lt;P&gt;DEFINE NAME / ORDER FORMAT= $8. ;&lt;/P&gt;&lt;P&gt;BREAK AFTER NAME / SUMMARIZE;&lt;/P&gt;&lt;P&gt;compute before NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hold = NAME;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute display_age / character length=40;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if NAME ne . then display_age = put(NAME,$8.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; else display_age = ' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) = 'NAME' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; brkline = 'Sum of NAME '||trim(put(hold,$8.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_age = brkline;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute after NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line ' ';&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217533#M14233</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-05-22T13:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217534#M14234</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; It looks like you did NOT use the same code. When I run the code from the posting you referenced, both program 1&lt;/P&gt;&lt;P&gt;&lt;IMG alt="program_1_works.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10555_program_1_works.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and program 2 work for me.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="program_2_works.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10556_program_2_works.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks to me as though you are trying to use NAME in your subtotal line. The challenge is two-fold -- PROC REPORT works from Left to Right when it builds a REPORT row. So, at the point in time when it is writing AGE and DISPLAY_AGE on the report, it has NO visibility of NAME. So when PROC REPORT is executing the COMPUTE block for DISPLAY_AGE, it doesn't know what the NAME is. Using NAME in your break (BREAK AFTER NAME/SUMMARIZE) doesn't make sense in your posted code, because there are 19 NAMES and the SUM for each NAME will appear underneath EACH NAME, as shown here by running your posted code (The only thing I changed in your code was that I changed the header for Display_AGE back to Display_AGE instead of NAME.)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="results_from_posted_code.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10557_results_from_posted_code.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I don't understand what it is you're trying to do. You want to call the variable Display_Age, but have it display the name? Somehow your real data must be different from SASHELP.CLASS. I am just not getting why you made the changes you made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a different example using SASHELP.SHOES. As you look at the picture, you will see that I am displaying PRODUCT in 3 different ways on the report. The first column for PRODUCT is the original variable from the dataset. It isn't "wide" enough for my entire text string to show on the break line. So, the 2nd column DISPLAY_PRODUCT1 used the PRODUCT item primarily to compute a custom break line. Then, DISPLAY_PRODUCT2 column shows how to "fill-in" the empty rows so that PRODUCT repeats on each line. Is this more what you are looking for????&lt;/P&gt;&lt;P&gt;&lt;IMG alt="diff_example.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10558_diff_example.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 16:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217534#M14234</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-22T16:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217535#M14235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;You are right, I did not execute the same code because I do not need the same&lt;/P&gt;&lt;P&gt;output.&lt;/P&gt;&lt;P&gt;I think you understood what I am trying to do because the last screen print you posted is exactly&lt;/P&gt;&lt;P&gt;what I needed. Indeed my real data is different to SASHELP.CLASS.&lt;/P&gt;&lt;P&gt;Sorry for not explaning the changes I made. I inteded to display the name of the grouped&lt;/P&gt;&lt;P&gt;observations as you did in the last screen print.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SASHELP.SHOES is exactly what I need!&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 12:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217535#M14235</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-05-26T12:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217536#M14236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you manage to "the 2nd column DISPLAY_PRODUCT1 used the PRODUCT item primarily to compute a custom break line." ?&lt;/P&gt;&lt;P&gt;I used to code found here:&lt;/P&gt;&lt;P&gt;Removed the styling but there is no total line at all, let alone one that has the name of the variable that was totalled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="51018" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value $gender 'F' = 'Female'&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'M' = 'Male';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;length gender $20 char_age $10;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;char_age = put(age,2.0);&lt;/P&gt;&lt;P&gt;gender = put(sex,$gender.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data = class nowd;&lt;/P&gt;&lt;P&gt;column sex gender age char_age name height weight;&lt;/P&gt;&lt;P&gt;define sex/order f=$gender.&amp;nbsp; noprint;&lt;/P&gt;&lt;P&gt;define gender /order;&lt;/P&gt;&lt;P&gt;define age/order noprint;&lt;/P&gt;&lt;P&gt;define char_age / order;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute gender;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) = 'GENDER' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gender = 'Total '|| trim(gender);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if upcase(_break_) = 'CHAR_AGE' then gender = ' ';&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute char_age;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) = 'CHAR_AGE' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Char_Age = 'Total '||trim(left(char_age));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems whatever I write next to my "trim" does not get displayed altough I have 3 break after´s.&lt;/P&gt;&lt;P&gt;It doesnt matter after which one I COMPUTE, there is no text shown of the variable displayed that is defined inside the "trim"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break after Species/ summarize SUPPRESS style=[backgroundcolor=#C8CCA8 fontsize=1 fontfamily=arial];&lt;/P&gt;&lt;P&gt;break after Animal/ summarize SUPPRESS style=[backgroundcolor=#F4F6E9 fontsize=1 fontfamily=arial];&lt;/P&gt;&lt;P&gt;break after Sample/ summarize SUPPRESS style=[backgroundcolor=#E5EAC1 fontsize=1 fontfamily=arial];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute SAMPLECAT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) = 'Species' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstanceName= total for x&amp;nbsp; '|| trim(put(Species,$char25.));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_) = 'Animal' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstanceName= 'total for y '|| trim(put(Animal,$char25.));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if upcase(_break_) = Sample' then SAMPLECAT = 'total for z '|| trim(put(SAMPLECAT,$char25.));&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 15:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217536#M14236</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2015-05-26T15:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217537#M14237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can this be done for PROC TABULATE? i.e., Can the name of the actual total-ing species in the sub heading be displayed instead of writing "total SPECIES"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shubha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217537#M14237</guid>
      <dc:creator>Shubha</dc:creator>
      <dc:date>2015-05-26T16:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217538#M14238</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; Sorry, I was offline for a while. Here's the code that created the screen shot for SASHELP.SHOES. When I made the 2 "extra" variables in the COMPUTE block, note how I made the LENGTH= big enough to hold my whole string: (length=55). That's because the string that you assign at the break (as shown for PRODUCT column) will get truncated to the length of the variable. And, as you can see&amp;nbsp; for PRODUCT, the string that I try to assign gets "cut off" and so, doesn't look right. I am guessing that your variable is not wide enough to hold the whole TOTAL string that you are trying to concatenate together.&lt;/P&gt;&lt;P&gt;&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;** sashelp.shoes has multiple obs per product/region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\customize_break_diff_ways.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;PROC REPORT DATA=sashelp.shoes nowd NOCENTER;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where region in ('Asia', 'Pacific', 'Canada');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title 'Different Example';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; COLUMN&amp;nbsp; product display_product1 display_product2 region n sales inventory returns;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define product / group /* noprint */;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define display_product1 / computed;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define display_product2 / computed;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define region / 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 n / 'Count';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define sales / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define inventory / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; define returns / mean;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** will use HOLDPROD for DISPLAY_PRODUCT2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute before product;&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;&amp;nbsp; length holdprod $55;&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;&amp;nbsp; holdprod = product;&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; break after product / summarize;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute after product;&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; product = catx(' ','Average for:', product);&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 ' ';&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute display_product1 / character length=55;&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; display_product1 = product;&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; if upcase(_break_) = 'PRODUCT' then &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_product1=catx(' ','Average and Count for:', product);&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; compute display_product2 / character length=55;&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; if product = ' ' then display_product2=holdprod;&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; else display_product2 = product;&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; if upcase(_break_) = 'PRODUCT' then &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; display_product2=catx(' ','Average and Count for:', product);&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;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;RUN;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 23:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217538#M14238</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-26T23:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc report dynamic sub total heading</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217539#M14239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you have to move to PROC REPORT to be able to customize the break line as shown in the screen shot for SASHELP.SHOES that was previously posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 23:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report-dynamic-sub-total-heading/m-p/217539#M14239</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-05-26T23:05:58Z</dc:date>
    </item>
  </channel>
</rss>

