<?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: Help with WHERE clause in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35083#M8599</link>
    <description>Never mind I've managed to sort it out. FYI I had to move 'OR' to the end of the line above where it was previously was.</description>
    <pubDate>Thu, 21 May 2009 14:52:07 GMT</pubDate>
    <dc:creator>hjkm</dc:creator>
    <dc:date>2009-05-21T14:52:07Z</dc:date>
    <item>
      <title>Help with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35082#M8598</link>
      <description>Hi, I'm having troubles with a WHERE clause in a program I am trying to execute. I have multiple conditions I'd like to incorporate but I am getting an error. If anyone has any tips I would appreciate it.&lt;BR /&gt;
&lt;BR /&gt;
Code is as follows. It's do with the OR statement in that WHERE query, but I'm not sure what I need to correct it. Any help appreciated.&lt;BR /&gt;
&lt;BR /&gt;
data table1; set work.table;&lt;BR /&gt;
where ColA="x"  and&lt;BR /&gt;
		((Col_date&amp;gt;='01Jan1990'd and ColB="yellow") &lt;BR /&gt;
		or (Col_date&amp;gt;='01Jan1990'd and ColB="blue")) ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Syntax error while parsing WHERE clause.&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, ), *, **, +, -, /, &amp;lt;, &amp;lt;=,&lt;BR /&gt;
              &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, GE, GT, LE, LT, NE, NOT, OR, ^, ^=, |, ||, ~, ~=.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored</description>
      <pubDate>Thu, 21 May 2009 13:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35082#M8598</guid>
      <dc:creator>hjkm</dc:creator>
      <dc:date>2009-05-21T13:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35083#M8599</link>
      <description>Never mind I've managed to sort it out. FYI I had to move 'OR' to the end of the line above where it was previously was.</description>
      <pubDate>Thu, 21 May 2009 14:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35083#M8599</guid>
      <dc:creator>hjkm</dc:creator>
      <dc:date>2009-05-21T14:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35084#M8600</link>
      <description>Although you fixed it by moving the 'OR', that was probably not the underlying problem.  There is a good chance that you had an unprintable character buried in the WHERE clause and, in moving the 'OR' you removed the offending character.&lt;BR /&gt;
&lt;BR /&gt;
BTW, you could simplify the logic of the WHERE to make it more readable (and probably more efficient) as&lt;BR /&gt;
&lt;BR /&gt;
where ColA="x" and &lt;BR /&gt;
         Col_date&amp;gt;='01Jan1990'd and &lt;BR /&gt;
         (ColB="yellow" or ColB="blue") ;&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Thu, 21 May 2009 15:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35084#M8600</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-05-21T15:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35085#M8601</link>
      <description>Hi, HJKM&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data table;&lt;BR /&gt;
cola='x';&lt;BR /&gt;
col_date='01Jan1990'd;&lt;BR /&gt;
colb='blue';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data table1; &lt;BR /&gt;
set work.table;&lt;BR /&gt;
where ColA="x" and&lt;BR /&gt;
           ((Col_date &amp;gt;= '01Jan1990'd and ColB = "yellow") or &lt;BR /&gt;
            (Col_date &amp;gt;= '01Jan1990'd and ColB = "blue")) ;&lt;BR /&gt;
&lt;BR /&gt;
format col_date ddmmyy10.;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 22 May 2009 05:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-WHERE-clause/m-p/35085#M8601</guid>
      <dc:creator>LOK</dc:creator>
      <dc:date>2009-05-22T05:41:54Z</dc:date>
    </item>
  </channel>
</rss>

