<?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 Multiple conditions in WHERE clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-in-WHERE-clause/m-p/612362#M178676</link>
    <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I'm trying to understand the WHERE clause below and I want to tweak the where clause to include the condition&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;put(INITIAL_DT,yymmn6.) &amp;lt;= put(REPORTING_DT,yymmn6.)&amp;nbsp;only&amp;nbsp;when&amp;nbsp;REPORTING_METHOD ^="ACS" &lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;If&lt;/CODE&gt; &lt;/FONT&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;REPORTING_METHOD ="OCS"&amp;nbsp;then&amp;nbsp;I&amp;nbsp;want&amp;nbsp;to&amp;nbsp;include&amp;nbsp;this&amp;nbsp;condition&amp;nbsp;put(INITIAL_DT,yymmn6.) &amp;gt;= put(REPORTING_DT,yymmn6.)&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set IFR.ADS_OUTPUT;
where (REPORTING_METHOD ^="ACS" or put(INITIAL_DT,yymmn6.) &amp;lt;= put(REPORTING_DT,yymmn6.))
 &amp;amp; 
(REPORTING_METHOD ^="OCS" or put(INITIAL_DT,yymmn6.) &amp;gt;= put(REPORTING_DT,yymmn6.));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to tackle this logic only using WHERE clause. Any help?&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 12:06:09 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2019-12-17T12:06:09Z</dc:date>
    <item>
      <title>Multiple conditions in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-in-WHERE-clause/m-p/612362#M178676</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I'm trying to understand the WHERE clause below and I want to tweak the where clause to include the condition&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;put(INITIAL_DT,yymmn6.) &amp;lt;= put(REPORTING_DT,yymmn6.)&amp;nbsp;only&amp;nbsp;when&amp;nbsp;REPORTING_METHOD ^="ACS" &lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;If&lt;/CODE&gt; &lt;/FONT&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;REPORTING_METHOD ="OCS"&amp;nbsp;then&amp;nbsp;I&amp;nbsp;want&amp;nbsp;to&amp;nbsp;include&amp;nbsp;this&amp;nbsp;condition&amp;nbsp;put(INITIAL_DT,yymmn6.) &amp;gt;= put(REPORTING_DT,yymmn6.)&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set IFR.ADS_OUTPUT;
where (REPORTING_METHOD ^="ACS" or put(INITIAL_DT,yymmn6.) &amp;lt;= put(REPORTING_DT,yymmn6.))
 &amp;amp; 
(REPORTING_METHOD ^="OCS" or put(INITIAL_DT,yymmn6.) &amp;gt;= put(REPORTING_DT,yymmn6.));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to tackle this logic only using WHERE clause. Any help?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-in-WHERE-clause/m-p/612362#M178676</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2019-12-17T12:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-in-WHERE-clause/m-p/612374#M178686</link>
      <description>&lt;P&gt;You've got your "and" and "or" wrong. According to your description, the condition should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where
  REPORTING_METHOD ^= "ACS" and put(INITIAL_DT,yymmn6.) &amp;lt;= put(REPORTING_DT,yymmn6.)
  or 
  REPORTING_METHOD ^= "OCS" and put(INITIAL_DT,yymmn6.) &amp;gt;= put(REPORTING_DT,yymmn6.)
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-in-WHERE-clause/m-p/612374#M178686</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-17T12:27:55Z</dc:date>
    </item>
  </channel>
</rss>

