<?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 Can someone please explain this code to me? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254764#M48616</link>
    <description>&lt;PRE&gt;data work.expertise;

INPUT ID Name $ Level;
	if level = . then expertise = 'Unknown';
	else if level = 1 then expertise = 'Low';
	else if level = 2 or 3 then expertise = 'Medium';
	else expertise = 'High';

DATALINES;
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
;
run;&lt;/PRE&gt;&lt;P&gt;I see what the problem is right away. &amp;nbsp;else if level = 2 or 3 then expertise = 'Medium'; &amp;nbsp;It should be level=2 OR level=3. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I don't understand is the code produces this output? &amp;nbsp;Any explanation would be nice. &amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2204iA22E43140F0B1C5E/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Screen Shot 2016-03-05 at 1.56.56 PM.png" title="Screen Shot 2016-03-05 at 1.56.56 PM.png" /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 05 Mar 2016 20:08:08 GMT</pubDate>
    <dc:creator>mcypert16</dc:creator>
    <dc:date>2016-03-05T20:08:08Z</dc:date>
    <item>
      <title>Can someone please explain this code to me?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254764#M48616</link>
      <description>&lt;PRE&gt;data work.expertise;

INPUT ID Name $ Level;
	if level = . then expertise = 'Unknown';
	else if level = 1 then expertise = 'Low';
	else if level = 2 or 3 then expertise = 'Medium';
	else expertise = 'High';

DATALINES;
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
;
run;&lt;/PRE&gt;&lt;P&gt;I see what the problem is right away. &amp;nbsp;else if level = 2 or 3 then expertise = 'Medium'; &amp;nbsp;It should be level=2 OR level=3. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I don't understand is the code produces this output? &amp;nbsp;Any explanation would be nice. &amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2204iA22E43140F0B1C5E/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Screen Shot 2016-03-05 at 1.56.56 PM.png" title="Screen Shot 2016-03-05 at 1.56.56 PM.png" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 20:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254764#M48616</guid>
      <dc:creator>mcypert16</dc:creator>
      <dc:date>2016-03-05T20:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone please explain this code to me?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254765#M48617</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70558"&gt;@mcypert16﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you seen &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/else-if/m-p/252467" target="_blank"&gt;this thread&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 20:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254765#M48617</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-05T20:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone please explain this code to me?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254768#M48618</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70558"&gt;@mcypert16﻿&lt;/a&gt;&amp;nbsp;May I ask where these questions are coming from?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 20:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254768#M48618</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-05T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone please explain this code to me?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254770#M48619</link>
      <description>&lt;P&gt;Yes. &amp;nbsp;They are from a website called &amp;nbsp;BI exam academy. &amp;nbsp;I understand the question now. &amp;nbsp;The else if level=2 or 3 is always true because 3 is nonmissing and not 0. &amp;nbsp;So the code never gets past line 3. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 20:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254770#M48619</guid>
      <dc:creator>mcypert16</dc:creator>
      <dc:date>2016-03-05T20:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone please explain this code to me?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254773#M48620</link>
      <description>&lt;P&gt;&lt;A href="http://biexamacademy.com/" target="_blank"&gt;http://biexamacademy.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 20:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-please-explain-this-code-to-me/m-p/254773#M48620</guid>
      <dc:creator>mcypert16</dc:creator>
      <dc:date>2016-03-05T20:56:50Z</dc:date>
    </item>
  </channel>
</rss>

