<?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: How to add &amp;quot;SUM&amp;quot; words in SUM line in PROC PRINT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256559#M57152</link>
    <description>&lt;P&gt;Ah, I see that's new with 9.4. If the OP is at an earlier release, this may be the cause for the ERRORs.&lt;/P&gt;
&lt;P&gt;I still don't think it gives one the necessary freedom in selecting where (which column) to put the labels. That's why PROC REPORT may be the (only) way to go.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2016 14:32:08 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-03-14T14:32:08Z</dc:date>
    <item>
      <title>How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256498#M57140</link>
      <description>&lt;P&gt;Hi all, i have used PROC PRINT to generate a report that i want. So far i managed to get my expected results.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2304i6F790B9F1BB60F8B/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="proc print data question.png" title="proc print data question.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;aaa&lt;/P&gt;&lt;P&gt;As you can see, i got a SUM after the last row. What i want now is to add the word "SUM" below "Java Programmer". Is there a way to do so? My code is as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=WORK.JOIN2BCAE obs='No.' label;
title 'Alfred Employee Bank Commitment/Financial Status';
var X_BCAE_NAME X_BCAE_POSITION X_BCAE_INCOME X_BCAE_CARLOAN X_BCAE_MORTGAGE X_BCAE_CASHFLOW newsum;
label X_BCAE_NAME = 'Name'
X_BCAE_POSITION = 'Position'
X_BCAE_INCOME = 'Income'
X_BCAE_CARLOAN = 'Car Loan Installment'
X_BCAE_MORTGAGE = 'Mortgage'
X_BCAE_CASHFLOW = 'Cash Flow'
newsum = 'Maximum New Loan';
sum X_BCAE_INCOME X_BCAE_CARLOAN X_BCAE_MORTGAGE X_BCAE_CASHFLOW newsum;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 08:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256498#M57140</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2016-03-14T08:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256504#M57141</link>
      <description>&lt;P&gt;PROC PRINT is a very simple procedure with minimal features. You can't do more with SUM than you already did.&lt;/P&gt;
&lt;P&gt;I recommend you take a look at the REPORT procedure for more flexible report creation.&lt;/P&gt;
&lt;P&gt;There you can set values for columns in a compute block for the time when a group switch occurs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define X_BCAE_POSITION / display 'Position';
compute X_BCAE_POSITION;
  if _break_='RBREAK' then do;
    call define("X_BCAE_POSITION", 'style', 'style=[pretext="Sum"]');
  end;
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can use the Wizard in Enterprise Guide to get the basic code for the PROC REPORT step and then experiment with manipulating the summary line&lt;/P&gt;
&lt;P&gt;This is sample code for SASHELP.CLASS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=SASHELP.CLASS nowd;
  column Name Sex Age, SUM=Age_SUM Height, SUM=Height_SUM Weight, SUM=Weight_SUM;
  define Name / group 'Name' missing;
  compute Name;
    if _break_ eq ' ' then do;
      if Name ne ' ' then hold1=Name;
    end;
    if upcase(_break_)="NAME" then do;
      call define("Name", 'style', 'style=[pretext="Zwischensumme "]');
    end;
  endcomp;
  define Sex / display 'Sex' missing;
  compute Sex;
    if _break_ eq ' ' then do;
      if Sex ne ' ' then hold2=Sex;
    end;
    if _break_='_RBREAK_' then do;
      call define("Sex", 'style', 'style=[pretext="Sum"]');
    end;
  endcomp;
  define Age / analysis SUM 'Age' missing;
  define Height / analysis SUM 'Height' missing;
  define Weight / analysis SUM 'Weight' missing;
  rbreak after / summarize;
  run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 09:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256504#M57141</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-14T09:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256505#M57142</link>
      <description>&lt;P&gt;Do SUMLABEL= give what you want?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 09:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256505#M57142</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-14T09:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256507#M57143</link>
      <description>&lt;P&gt;Thx for the advice. Will look into PROC REPORT but as for this moment, PROC REPORT is quite confusing for me....It is not as easy as you may think for me.....think i will need a lot more time to further research on this topic.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 09:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256507#M57143</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2016-03-14T09:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256509#M57144</link>
      <description>&lt;P&gt;It is also very confusing for me, as I'm more of a data architect than report creator, so I rarely get to tinker with it.&lt;/P&gt;
&lt;P&gt;All I did was create a report with the wizard in EG and then play around with the statements in the compute block until I got the desired result.&lt;/P&gt;
&lt;P&gt;So you see, even for seasoned SAS users the helpers in EG can be very convenient at times.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 09:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256509#M57144</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-14T09:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256512#M57145</link>
      <description>&lt;P&gt;it will prompt error whenever i use SUMLBEL = or SUMLABEL&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 09:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256512#M57145</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2016-03-14T09:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256520#M57146</link>
      <description>&lt;P&gt;As always when you want help with errors, attach the full log.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 10:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256520#M57146</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-14T10:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256524#M57147</link>
      <description>&lt;P&gt;I don't think that SUMLABEL does what he wants. SUMLABEL only causes the &lt;U&gt;Label&lt;/U&gt; of the BY variable to be displayed in the summary line (instead of the simple variable name).&lt;/P&gt;
&lt;P&gt;Since he wants to display some arbitrary text in a column of a non-BY variable, this won't help.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 10:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256524#M57147</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-14T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256527#M57148</link>
      <description>&lt;P&gt;"&lt;STRONG&gt;SUMLABEL='&lt;SPAN class="xis-userSuppliedValue"&gt;label&lt;/SPAN&gt;'&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;specifies the text to use as a label on the summary line of a BY group. You can include the #BYVAR and #BYVAL variables in '&lt;SPAN class="xis-userSuppliedValue"&gt;label&lt;/SPAN&gt;'."&lt;/P&gt;
&lt;P class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xis-paraSimpleFirst"&gt;I think this will cover the OPs requirement, no?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Mar 2016 11:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256527#M57148</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-14T11:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256528#M57149</link>
      <description>&lt;P&gt;From his example, I deduce that X_BCAE_POSITION (the column where he wants the "Sum" to be located) is not a BY variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 11:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256528#M57149</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-14T11:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256551#M57151</link>
      <description>&lt;P&gt;Oops, missed that&amp;nbsp;&lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://communities.sas.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;&lt;/P&gt;
&lt;P&gt;What about&amp;nbsp;GRANDTOTAL_LABEL='&lt;SPAN class="xis-userSuppliedValue"&gt;label&lt;/SPAN&gt;'?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 14:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256551#M57151</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-14T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256559#M57152</link>
      <description>&lt;P&gt;Ah, I see that's new with 9.4. If the OP is at an earlier release, this may be the cause for the ERRORs.&lt;/P&gt;
&lt;P&gt;I still don't think it gives one the necessary freedom in selecting where (which column) to put the labels. That's why PROC REPORT may be the (only) way to go.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 14:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256559#M57152</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-14T14:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256679#M57168</link>
      <description>&lt;P&gt;This could be easy done by SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select name label='xxxxx', sex ,weight ,height
 from sashelp.class
 union all
select ' ','Sum:',sum(weight ),sum(height)
 from sashelp.class;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Mar 2016 02:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256679#M57168</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-15T02:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256681#M57169</link>
      <description>&lt;P&gt;Hey My Xia, you mean after my last PROC PRINT statement?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 02:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256681#M57169</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2016-03-15T02:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "SUM" words in SUM line in PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256683#M57171</link>
      <description>&lt;P&gt;No. That is another whole different way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you stick with PROC PRINT, then SQL is not for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 02:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-quot-SUM-quot-words-in-SUM-line-in-PROC-PRINT/m-p/256683#M57171</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-15T02:43:23Z</dc:date>
    </item>
  </channel>
</rss>

