<?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 sum in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/sum/m-p/35871#M8913</link>
    <description>a=3+.;&lt;BR /&gt;
b=.+.;&lt;BR /&gt;
c=sum(3,.);&lt;BR /&gt;
d=sum(.,.);&lt;BR /&gt;
what will the result? how it comes? please explain&lt;BR /&gt;
Thanks in advance.</description>
    <pubDate>Thu, 31 Dec 2009 05:40:06 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-12-31T05:40:06Z</dc:date>
    <item>
      <title>sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sum/m-p/35871#M8913</link>
      <description>a=3+.;&lt;BR /&gt;
b=.+.;&lt;BR /&gt;
c=sum(3,.);&lt;BR /&gt;
d=sum(.,.);&lt;BR /&gt;
what will the result? how it comes? please explain&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Thu, 31 Dec 2009 05:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sum/m-p/35871#M8913</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-31T05:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: sum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sum/m-p/35872#M8914</link>
      <description>Hi:&lt;BR /&gt;
  To find the results, you need to put the statements in a DATA step program. The program code and results are shown below from the SAS log:&lt;BR /&gt;
[pre]&lt;BR /&gt;
1077  data testsum;&lt;BR /&gt;
1078  a=3+.;&lt;BR /&gt;
1079  b=.+.;&lt;BR /&gt;
1080  c=sum(3,.);&lt;BR /&gt;
1081  d=sum(.,.);&lt;BR /&gt;
1082  put _all_;&lt;BR /&gt;
1083  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;
      Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;
      1078:4   1079:4&lt;BR /&gt;
a=. b=. c=3 d=. _ERROR_=0 _N_=1&lt;BR /&gt;
NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;
      Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;
      1 at 1081:3&lt;BR /&gt;
NOTE: The data set WORK.TESTSUM has 1 observations and 4 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.07 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
                               &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                     &lt;BR /&gt;
The SUM function returns the sum of non-missing values, as clearly explained in the documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000245953.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000245953.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
The documentation on assignment statements also explains how missing values are treated when you work with arithmetic operators in an assignment statement:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001334675.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001334675.htm&lt;/A&gt;&lt;BR /&gt;
 In particular, look for the section entitled "Propagation of MIssing Values", where it states that:&lt;B&gt;&lt;BR /&gt;
"When you use a missing value in an arithmetic expression, SAS sets the result of the expression to missing. If you use that result in another expression, the next result is also missing. In SAS, this method of treating missing values is called propagation of missing values."&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 31 Dec 2009 07:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sum/m-p/35872#M8914</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-12-31T07:41:28Z</dc:date>
    </item>
  </channel>
</rss>

