<?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 it evaluates ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281496#M57103</link>
    <description>&lt;P&gt;3 is always true.&amp;nbsp; It has nothing to do with LEVEL, as if you had coded:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if (3) or (level=2) then expertise='Medium';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, 0 and missing values are false, and all other numbers are true.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This syntax would work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if level in (2, 3) then expertise='Medium';&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 16:22:14 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-30T16:22:14Z</dc:date>
    <item>
      <title>how it evaluates ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281488#M57098</link>
      <description>&lt;DIV class="page"&gt;&lt;DIV class="section"&gt;&lt;DIV class="layoutArea"&gt;&lt;DIV class="column"&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.expertise;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; set work.levels;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if level = . then expertise = 'Unknown'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else if level = 1 then expertise = 'Low'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else if level = 2 or 3 then expertise = 'Medium';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else &amp;nbsp;expertise = 'High';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i supply level=4 why its taking expertise = "Medium" instead of "High" ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;it gives proper output when i define if condition like " level=2 or level=3 " why so ?&lt;BR /&gt;&lt;BR /&gt;curious to know how sas is processing level=2 or 3 ! Thanks ! &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281488#M57098</guid>
      <dc:creator>Attyslogin</dc:creator>
      <dc:date>2016-06-30T15:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: how it evaluates ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281496#M57103</link>
      <description>&lt;P&gt;3 is always true.&amp;nbsp; It has nothing to do with LEVEL, as if you had coded:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if (3) or (level=2) then expertise='Medium';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, 0 and missing values are false, and all other numbers are true.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This syntax would work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if level in (2, 3) then expertise='Medium';&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 16:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281496#M57103</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-30T16:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: how it evaluates ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281529#M57110</link>
      <description>&lt;P&gt;&lt;SPAN&gt;SAS is not natural language, it makes fewer assumptions;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;else if level = 2 or 3 then expertise = 'Medium'&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should be coded as:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;else if level = 2 or level = 3 then expertise = 'Medium';&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 17:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-it-evaluates/m-p/281529#M57110</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-06-30T17:47:00Z</dc:date>
    </item>
  </channel>
</rss>

