<?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: Using the 'or' statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366342#M64851</link>
    <description>&lt;P&gt;OR is incorrect.&amp;nbsp; For example, if the value is PUBLIC, then the comparison ne 'UNKNOWN' must be true.&amp;nbsp; Just change OR to AND.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you may find this easier to read (provided that you want to compare BTYPE each time, and not SCHTYPE):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if btype not in ('PUBLIC', 'PRIVATE', 'UNKNOWN') then btype_error=1;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 21:16:16 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-06-12T21:16:16Z</dc:date>
    <item>
      <title>Using the 'or' statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366340#M64849</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to write code that will catch any fields that aren't within 3 specified values for buildingtype:&amp;nbsp; PUBLIC, PRIVATE, AND UNKNOWN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data clean;
set have;
 btype_error=0;
  if btype ne 'PUBLIC'  or btype ne 'PRIVATE' or btype ne 'UNKNOWN' then btype_error=1;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, I'm getting btype_error=1 for all of the observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I doing wrong? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 15:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366340#M64849</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-06-13T15:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using the 'or' statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366342#M64851</link>
      <description>&lt;P&gt;OR is incorrect.&amp;nbsp; For example, if the value is PUBLIC, then the comparison ne 'UNKNOWN' must be true.&amp;nbsp; Just change OR to AND.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you may find this easier to read (provided that you want to compare BTYPE each time, and not SCHTYPE):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if btype not in ('PUBLIC', 'PRIVATE', 'UNKNOWN') then btype_error=1;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 21:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366342#M64851</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-06-12T21:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using the 'or' statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366664#M64879</link>
      <description>Thank you very much!</description>
      <pubDate>Tue, 13 Jun 2017 15:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366664#M64879</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-06-13T15:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using the 'or' statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366669#M64881</link>
      <description>&lt;P&gt;Yes, I want to compare btype every time.&amp;nbsp; schtype was a typo. I edited it and replaced it with btype.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 15:57:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-the-or-statement/m-p/366669#M64881</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-06-13T15:57:59Z</dc:date>
    </item>
  </channel>
</rss>

