<?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: Missing Values Generated Note in LOG file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333055#M75005</link>
    <description>&lt;P&gt;So do SAS ignores conditions joined by AND when first condition in FALSE?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 15:40:14 GMT</pubDate>
    <dc:creator>Raffik</dc:creator>
    <dc:date>2017-02-15T15:40:14Z</dc:date>
    <item>
      <title>Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333019#M74997</link>
      <description>&lt;P&gt;I have such code and a warning in log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;c='';&lt;BR /&gt;a = .;&lt;BR /&gt;b = 7;&lt;BR /&gt;if NOT MISSING(c) and (a+b)&amp;gt;6 then l = 'A';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i use another code whith a small change, I have no warning in log file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;c='';&lt;BR /&gt;a = .;&lt;BR /&gt;b = 7;&lt;BR /&gt;if c^='' and (a+b)&amp;gt;6 then l = 'A';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 14:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333019#M74997</guid>
      <dc:creator>Raffik</dc:creator>
      <dc:date>2017-02-15T14:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333028#M74998</link>
      <description>&lt;P&gt;I guess you don't get a WARNING, but a NOTE about the operation on missing values?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 14:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333028#M74998</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-15T14:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333043#M75001</link>
      <description>&lt;P&gt;I have a guess, but can't confirm it.&amp;nbsp; You would need someone from a development team at SAS to confirm or deny ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When SAS sees two conditions joined by AND, it has options as to which one it evaluates first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the top code:&amp;nbsp; since the first condition uses a function, SAS "figures" that it might be speedier to start by evaluating the second condition.&amp;nbsp; It tries to add a+b, and generates the missing value with the accompanying note.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the bottom code:&amp;nbsp; since the first condition is a simple comparison, SAS evaluates that first.&amp;nbsp; Since it is false, there is no need to try to add a+b.&amp;nbsp; Once the first condition is false, the entire compound condition must be false.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333043#M75001</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-15T15:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333048#M75003</link>
      <description>&lt;P&gt;Yes, you are right&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333048#M75003</guid>
      <dc:creator>Raffik</dc:creator>
      <dc:date>2017-02-15T15:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333055#M75005</link>
      <description>&lt;P&gt;So do SAS ignores conditions joined by AND when first condition in FALSE?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333055#M75005</guid>
      <dc:creator>Raffik</dc:creator>
      <dc:date>2017-02-15T15:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333065#M75008</link>
      <description>&lt;P&gt;That's right.&amp;nbsp; Doesn't it make sense?&amp;nbsp; Once a false condition is found, there is no need to check the other conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a program you can run to verify this.&amp;nbsp; Note how long it takes to run each DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data _null_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;do i=1 to 100000000;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; if 1=1 and 5=4 then x=1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;end;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data _null_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;do i=1 to 10000000;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; if 1=2 and 5=4 then x=1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;end;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the first DATA step has to check both conditions, it will take longer.&amp;nbsp; Since the second DATA step only needs to check one condition, it will be faster.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333065#M75008</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-15T15:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333259#M75064</link>
      <description>&lt;PRE&gt;
It due to missing value in either A or B, Try SUM() to avoid it.

if NOT MISSING(c) and sum(a,b)&amp;gt;6 then l = 'A';


&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333259#M75064</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-02-16T03:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333272#M75069</link>
      <description>&lt;P&gt;Looks like SAS is smart enough to know how to "short-circuit" logic evaluation when using normal operators like = or ^=, but it does not try to do it when you using the MISSING() function. &amp;nbsp;If you want it to always short-circuit the logic then code it that way yourself.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF not missing(c) THEN
  IF (a+b)&amp;gt;6 THEN put 'FOUND'
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 04:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333272#M75069</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-02-16T04:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333297#M75072</link>
      <description>&lt;P&gt;What about this one,&lt;/P&gt;&lt;P&gt;in that case I have Note in log&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data test;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c='';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a = .;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;b = 7;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if NOT MISSING(c) and (a+b)&amp;gt;6 then l = 'A';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this code I have no Note&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data test;&lt;BR /&gt;c='';&lt;BR /&gt;a = .;&lt;BR /&gt;b = 7;&lt;BR /&gt;if MISSING(c)=0 and (a+b)&amp;gt;6 then l = 'A';&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 06:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333297#M75072</guid>
      <dc:creator>Raffik</dc:creator>
      <dc:date>2017-02-16T06:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333299#M75073</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/102102"&gt;@Raffik&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;So do SAS ignores conditions joined by AND when first condition in FALSE?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This type of optimization is used in all programming environments. The decision which condition is evaluated first will differ of course between, say, SAS and a C compiler.&lt;/P&gt;
&lt;P&gt;You can even help with this optimization by explicitly forcing the sequence of evaluation by the way you code the conditions, as has already been stated in another post.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 06:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333299#M75073</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-16T06:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Values Generated Note in LOG file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333435#M75131</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data test;&lt;BR /&gt;c='';&lt;BR /&gt;a = .;&lt;BR /&gt;b = 7;&lt;BR /&gt;if MISSING(c)=0 and (a+b)&amp;gt;6 then l = 'A';&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MISSING(c) is True so returns 1 as the value, compared to 0 is FALSE so the comparisons stop&amp;nbsp;&amp;nbsp;and do not execute teh remainder of the line.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You also need to consider the behavior of (a+b). If either a or b are missing the result is missing so you never have anything &amp;gt; 6 .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Look at this for a slightly larger example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data test;
   input a b c $;
   if MISSING(c)=0 and (a+b)&amp;gt;6 then l = 'A';
   if MISSING(c)=0 and sum(a,b)&amp;gt;6 then l2 = 'A';
datalines;
. 7 .
. 7 b
1 1 1
8 1 1
8 1 .1
8 . 1
1 2 .
. 2 .
;
run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 15:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Values-Generated-Note-in-LOG-file/m-p/333435#M75131</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-16T15:48:15Z</dc:date>
    </item>
  </channel>
</rss>

