<?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 difference between sum() and +&amp;lt;operator&amp;gt; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/392751#M94548</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.passengers;
TransPassengers = 100;
OrigPassengers = .;
Totalusingoperator = OrigPassengers + TransPassengers;
Totalusingfunction = Sum(OrigPassengers,TransPassengers);
put Totalusingoperator;
put Totalusingfunction;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please explain the logic of output why value&amp;nbsp;of &lt;STRONG&gt;Totalusingoperator&lt;/STRONG&gt; is &lt;STRONG&gt;.&lt;/STRONG&gt; and &lt;STRONG&gt;Totalusingfunction&lt;/STRONG&gt; is &lt;STRONG&gt;100&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Ayushmaan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Sep 2017 14:38:08 GMT</pubDate>
    <dc:creator>ab12nov</dc:creator>
    <dc:date>2017-09-02T14:38:08Z</dc:date>
    <item>
      <title>difference between sum() and +&lt;operator&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/392751#M94548</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.passengers;
TransPassengers = 100;
OrigPassengers = .;
Totalusingoperator = OrigPassengers + TransPassengers;
Totalusingfunction = Sum(OrigPassengers,TransPassengers);
put Totalusingoperator;
put Totalusingfunction;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please explain the logic of output why value&amp;nbsp;of &lt;STRONG&gt;Totalusingoperator&lt;/STRONG&gt; is &lt;STRONG&gt;.&lt;/STRONG&gt; and &lt;STRONG&gt;Totalusingfunction&lt;/STRONG&gt; is &lt;STRONG&gt;100&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Ayushmaan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2017 14:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/392751#M94548</guid>
      <dc:creator>ab12nov</dc:creator>
      <dc:date>2017-09-02T14:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: difference between sum() and +&lt;operator&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/392753#M94550</link>
      <description>&lt;P&gt;As you can see in the documentation for the SUM function &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245953.htm" target="_self"&gt;here&lt;/A&gt;, &amp;nbsp;the SUM function "&lt;SPAN&gt;Returns the sum of the nonmissing arguments.", i.e. the sum function ignores the missing value. On the other hand, when you use a missing value with an arithmetic operator (+, - etc), it returnsa missing value.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2017 14:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/392753#M94550</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-09-02T14:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: difference between sum() and +&lt;operator&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/480934#M124320</link>
      <description>&lt;P&gt;Hello - for&amp;nbsp;cumulative sum we use (+) plus sum operator instead of sum function but still we get non-missing value, isn't it. can you please explain why? let me know please you don't&amp;nbsp;get my concern?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/480934#M124320</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-07-24T20:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: difference between sum() and +&lt;operator&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/724916#M225089</link>
      <description>&lt;P&gt;Thats&amp;nbsp; of&amp;nbsp; Accumalting column effect. One need to use RETAIN syntax for retaining the initial&amp;nbsp; value . Use SUM operator instead&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 17:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/difference-between-sum-and-lt-operator-gt/m-p/724916#M225089</guid>
      <dc:creator>T_Hasan</dc:creator>
      <dc:date>2021-03-09T17:08:14Z</dc:date>
    </item>
  </channel>
</rss>

