<?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: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391500#M94027</link>
    <description>&lt;P&gt;You could write a simple data step and see what happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need ot use of in sum or mean function while not using wildcards. The functions sum and mean ignore missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
   input a b;

   c = a + b;
   d = sum(a, b);
   e = mean(a, b);
   f = a;
   g = b;
   f + g;

   label 
      c = 'a+b'
      d = 'sum(a, b)'
      e = 'mean(a, b)'
      f = 'f=b; f+g'
      g = 'b'
   ;

   datalines;
. 1
1 .
1 1
. .
;
run;

proc print data=work.test label;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Aug 2017 14:44:39 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2017-08-29T14:44:39Z</dc:date>
    <item>
      <title>Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391483#M94019</link>
      <description>&lt;P&gt;Hi I am studying for the Base Certification Exam and I have a quetion over Assignment Statement, Sum Statement, Sum Function, and missing values. Assignment Statements are all statements in the form of A=a+b and will always produce a missing value if a missing value is present in the data, correct? Sum statements a+b and sum functions sum(of a,b) will ignore missing values if present in the data, correct? If a statement consists of a combination of the two Avg=mean(of a,b) this is ultimately in the form of an assignment statement so the missing value would produce missing data for the remaining output - is this correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help or reference you can provide me for clarification on this material.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 14:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391483#M94019</guid>
      <dc:creator>kmj636</dc:creator>
      <dc:date>2017-08-29T14:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391497#M94025</link>
      <description>&lt;P&gt;Look up each statement and review it's specific documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#titlepage.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#titlepage.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 14:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391497#M94025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-29T14:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391498#M94026</link>
      <description>&lt;P&gt;You were doing great until you got to the MEAN function.&amp;nbsp; The MEAN function ignores missing arguments, and computes the mean of the non-missing arguments.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 14:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391498#M94026</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-08-29T14:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391500#M94027</link>
      <description>&lt;P&gt;You could write a simple data step and see what happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need ot use of in sum or mean function while not using wildcards. The functions sum and mean ignore missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
   input a b;

   c = a + b;
   d = sum(a, b);
   e = mean(a, b);
   f = a;
   g = b;
   f + g;

   label 
      c = 'a+b'
      d = 'sum(a, b)'
      e = 'mean(a, b)'
      f = 'f=b; f+g'
      g = 'b'
   ;

   datalines;
. 1
1 .
1 1
. .
;
run;

proc print data=work.test label;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 14:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391500#M94027</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-08-29T14:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391530#M94044</link>
      <description>&lt;P&gt;Hello KMJ,&lt;/P&gt;&lt;P&gt;You are correct.&amp;nbsp; Assignment statements result in NULL if any operand is a NULL value.&amp;nbsp; Sum statements and Sum functions do ignore NULL values in their final result.&amp;nbsp;&amp;nbsp; Regarding your last question, The functions, operands and operators on the right side of the equation drive the result.&amp;nbsp; In your example, AVG is assigned the result since the MEAN function parameters that are NULL are ignored.&amp;nbsp; If you tried to subtraction or add a NULL value, AVG=MEAN(of a1=a4)&amp;nbsp; - null_val, then the AVG would be NULL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code demonstrates each of your questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA x;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *** Assignment question ***; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; x=10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; y=.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; A=x+y;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT "=================";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT A= ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *** SUM() Question ***;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; d1=10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; d2=20;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; d3=30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; d4=.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; D=SUM( of d1-d4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT D=;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *** Combining Assignment and Function statements Question***;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; E=MEAN(of d1-d4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT E=;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; F=MEAN(of d1-d4) - d4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT F=;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PUT "=================";&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;RUN;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *** SUM Statement Question***;&lt;BR /&gt;DATA x2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INFILE DATALINES;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LENGTH val 8;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INPUT val ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; val_sum + val; ** &amp;lt;- sum statement **;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; DATALINES;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 10&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;&amp;nbsp;&amp;nbsp; .&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;RUN;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;PROC PRINT; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DATALINES;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 10&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;&amp;nbsp;&amp;nbsp; .&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;RUN;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;PROC PRINT; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;========================LOG=====================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;=================&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;A=.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;D=60&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;E=20&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;F=.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;=================&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;1 at 66:7 1 at 84:21&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.X has 1 observations and 10 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;P&gt;========================OUTPUT=====================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;val&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;val_sum&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;30&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;30&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;60&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391530#M94044</guid>
      <dc:creator>Coloradomis</dc:creator>
      <dc:date>2017-08-29T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391536#M94048</link>
      <description>&lt;P&gt;Thank you so much this was helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391536#M94048</guid>
      <dc:creator>kmj636</dc:creator>
      <dc:date>2017-08-29T15:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Base Certification Assignment Statement, Sum Statement, Sum Function, and missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391537#M94049</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-Certification-Assignment-Statement-Sum-Statement-Sum/m-p/391537#M94049</guid>
      <dc:creator>kmj636</dc:creator>
      <dc:date>2017-08-29T15:41:29Z</dc:date>
    </item>
  </channel>
</rss>

