<?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 Where clause condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63290#M13765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Its a very basic condition in where clause..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data person;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input name $ dept;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;BR /&gt;John 1&lt;BR /&gt;Mary 1&lt;BR /&gt;Matt 2&lt;BR /&gt;Rob&amp;nbsp; 3&lt;BR /&gt;Mary 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data filter;&lt;BR /&gt;set person;&lt;BR /&gt;where dept ^=1 and name ^= "John";&lt;BR /&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run the above datastep, why is it excluding all rows whose department is 1 or name is John.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should exclude only if dept is 1 and name is John.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Sep 2011 11:15:22 GMT</pubDate>
    <dc:creator>kishore415</dc:creator>
    <dc:date>2011-09-12T11:15:22Z</dc:date>
    <item>
      <title>Where clause condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63290#M13765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Its a very basic condition in where clause..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data person;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input name $ dept;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;BR /&gt;John 1&lt;BR /&gt;Mary 1&lt;BR /&gt;Matt 2&lt;BR /&gt;Rob&amp;nbsp; 3&lt;BR /&gt;Mary 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data filter;&lt;BR /&gt;set person;&lt;BR /&gt;where dept ^=1 and name ^= "John";&lt;BR /&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run the above datastep, why is it excluding all rows whose department is 1 or name is John.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should exclude only if dept is 1 and name is John.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 11:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63290#M13765</guid>
      <dc:creator>kishore415</dc:creator>
      <dc:date>2011-09-12T11:15:22Z</dc:date>
    </item>
    <item>
      <title>Where clause condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63291#M13766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is doing what you asked. If you want it only exclude cases with 1 and John then change to:&lt;/P&gt;&lt;P&gt;where not (dept=1 and name='John');&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;where dept^=1 or name^='John' ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 11:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63291#M13766</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-12T11:21:03Z</dc:date>
    </item>
    <item>
      <title>Where clause condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63292#M13767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or, if you have a hard time understanding double negatives, just use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where not(dept=1 and name='John')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 14:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-clause-condition/m-p/63292#M13767</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T14:37:29Z</dc:date>
    </item>
  </channel>
</rss>

