<?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 or operator in if and then statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301872#M63944</link>
    <description>&lt;P&gt;The log should tell you the offending record which should help you narrow down the issue in your logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, verify if you want OR or AND&lt;/P&gt;</description>
    <pubDate>Sat, 01 Oct 2016 04:45:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-01T04:45:55Z</dc:date>
    <item>
      <title>Using or operator in if and then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301870#M63943</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data vdate variable contains the following values. &amp;nbsp;I used the following code to convert to isodate. But it gives me " Invalid argument to function INPUT function".&lt;/P&gt;&lt;P&gt;Pleas help why.]&lt;/P&gt;&lt;P&gt;I think my code looks ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vdate(character)&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17/Jul/2015&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UN/Jan/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if vdate &amp;nbsp;^= '' &amp;nbsp;or compress(vdate,'/') ^= &lt;FONT color="#FF0000"&gt;:&lt;/FONT&gt; 'UN' then date1=put(input(vdate,date11.),is8601da.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2016 04:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301870#M63943</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-10-01T04:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using or operator in if and then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301872#M63944</link>
      <description>&lt;P&gt;The log should tell you the offending record which should help you narrow down the issue in your logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, verify if you want OR or AND&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2016 04:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301872#M63944</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-01T04:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using or operator in if and then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301879#M63945</link>
      <description>&lt;P&gt;What you realy meant by:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;if vdate &amp;nbsp;^= '' &amp;nbsp;or compress(vdate,'/') ^= &lt;FONT color="#FF0000"&gt;:&lt;/FONT&gt; 'UN' then date1=put(input(vdate,date11.),is8601da.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;is &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;if &amp;nbsp; &lt;STRONG&gt;NOT&lt;/STRONG&gt; (vdate = ' ' &amp;nbsp;or compress(vdate,'/') = &lt;FONT color="#FF0000"&gt;:&lt;/FONT&gt; 'UN' ) &amp;nbsp;then date1=put(input(vdate,date11.),is8601da.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which, after opening the brackets convert into:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if vdate &amp;nbsp;^= ' ' &amp;nbsp;&lt;STRONG&gt;AND &amp;nbsp;&lt;/STRONG&gt;compress(vdate,'/') ^= &lt;FONT color="#FF0000"&gt;:&lt;/FONT&gt; 'UN' then date1=put(input(vdate,date11.),is8601da.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other solution is: &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;date1=put(input(vdate,&lt;STRONG&gt;??&lt;/STRONG&gt; date11.),is8601da.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which in case of vdate is not valid then date1 is missing value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2016 09:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301879#M63945</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-01T09:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using or operator in if and then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301882#M63946</link>
      <description>&lt;P&gt;While I agree with the earlier comments, it might be easiest to understand the observations you are processing if you switched to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if not (vdate in &lt;STRONG&gt;:&lt;/STRONG&gt; (' ', 'UN')) then .....;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way you have written the logic, every single observation meets the IF conditions.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2016 10:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-or-operator-in-if-and-then-statement/m-p/301882#M63946</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-01T10:29:31Z</dc:date>
    </item>
  </channel>
</rss>

