<?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: If then statement with conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-then-statement-with-conditions/m-p/837438#M331101</link>
    <description>&lt;P&gt;Your date comparisons are incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want ; 

set have ;

if Year &amp;lt;2015 
    and not ( '24Sep2014'd &amp;lt;= date &amp;lt;= '08Oct2014'd) 
    and Group_ID &amp;gt; 15 
              then Group_ID = 14;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133090"&gt;@RandyStan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear All:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I am trying a IF/THEN statement and I do not seem to get the syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The conditions are as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If Year &amp;lt; 2015 and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;date not between 24SEP2014 and 08OCT2014 and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Group_ID &amp;gt;15 then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Group_ID = 14&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want ; set have ;&lt;/P&gt;
&lt;P&gt;if Year &amp;lt;2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID &amp;gt; 15 then do;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Group_ID = 14;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;I do not seem to get the date statement correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 16:39:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-10-07T16:39:29Z</dc:date>
    <item>
      <title>If then statement with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-statement-with-conditions/m-p/837436#M331100</link>
      <description>&lt;P&gt;Dear All:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am trying a IF/THEN statement and I do not seem to get the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The conditions are as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If Year &amp;lt; 2015 and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;date not between 24SEP2014 and 08OCT2014 and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Group_ID &amp;gt;15 then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Group_ID = 14&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data want ; set have ;&lt;/P&gt;&lt;P&gt;if Year &amp;lt;2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID &amp;gt; 15 then do;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group_ID = 14;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;I do not seem to get the date statement correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 16:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-statement-with-conditions/m-p/837436#M331100</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2022-10-07T16:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-statement-with-conditions/m-p/837438#M331101</link>
      <description>&lt;P&gt;Your date comparisons are incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want ; 

set have ;

if Year &amp;lt;2015 
    and not ( '24Sep2014'd &amp;lt;= date &amp;lt;= '08Oct2014'd) 
    and Group_ID &amp;gt; 15 
              then Group_ID = 14;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133090"&gt;@RandyStan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear All:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I am trying a IF/THEN statement and I do not seem to get the syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The conditions are as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If Year &amp;lt; 2015 and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;date not between 24SEP2014 and 08OCT2014 and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Group_ID &amp;gt;15 then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Group_ID = 14&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want ; set have ;&lt;/P&gt;
&lt;P&gt;if Year &amp;lt;2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID &amp;gt; 15 then do;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Group_ID = 14;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;I do not seem to get the date statement correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 16:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-statement-with-conditions/m-p/837438#M331101</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-07T16:39:29Z</dc:date>
    </item>
  </channel>
</rss>

