<?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 me add 2 more conditions  - multiple if then do condtions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506373#M135735</link>
    <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please disregard my posting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definitions have changed and what I have posted earlier does not apply any longer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Oct 2018 09:28:13 GMT</pubDate>
    <dc:creator>Timbim</dc:creator>
    <dc:date>2018-10-22T09:28:13Z</dc:date>
    <item>
      <title>Help me add 2 more conditions  - multiple if then do condtions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506292#M135696</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project and need to make some adjustments to a SAS code written by&amp;nbsp; a good SAS programmer and need some of your help to add 2 more conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To the following code I need to add two things:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;FONT face="arial,helvetica,sans-serif"&gt;. If the P_code in 107, 108,109,110 then&amp;nbsp; exlude from the calculation &lt;FONT size="2"&gt;UFA=round(UFR*increase,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;2. UFA&amp;nbsp;= balance on opendate minus O_balance 5 days after opening date.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;The existing conditions in the following code applies now and going forward however conditions 1 &amp;amp; 2 that are mentioned above must take place after January 01 2019&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; work.eom_processed;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.eom;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;"&amp;amp;StartM."d&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;lt;= OpenDate &amp;lt;= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;"&amp;amp;EndM."d&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;or (ChgFlag=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'F'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; and put(strip(put(pcode,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$pc3l.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'LOC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; L_Amt in (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Reason=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'NF'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; RW_Ind=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Y'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; B_Ind=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Y'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; or (B_Ind ne &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Y'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; and pct_increase &amp;lt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0.3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;UFA=round(UFR*increase,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pct_increase &amp;lt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Reason=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'RW &amp;lt; Original'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;C_Ind=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Y'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;UFA=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;UFA=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Reason=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Over 30%'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; UFA=round(UFR*L_Amt,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TBRatio &amp;lt;= TBBonusMax &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TBBonusAmt=round(min(TBBonusLimit, L_Amt)*TBBonusRate,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Grateful for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Magstar&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 05:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506292#M135696</guid>
      <dc:creator>Timbim</dc:creator>
      <dc:date>2018-10-21T05:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help me add 2 more conditions  - multiple if then do condtions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506306#M135704</link>
      <description>&lt;P&gt;I feel you need add your conditions within next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if RW_Ind='Y' then do;
   if B_Ind='Y' or (B_Ind ne 'Y' and pct_increase &amp;lt; 0.3) then do;
      UFA=round(UFR*increase,0.01);
      if pct_increase &amp;lt; 0 then do;
          Reason='RW &amp;lt; Original';
          C_Ind='Y';
          UFA=0;
       end;
   end;
..................&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I'm not sure I understand exactly what you mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should OpenDate or run date be January 1st 2019 and on in order to use the new conditions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First condition can be&amp;nbsp; entered as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if RW_Ind='Y' then do;
   if B_Ind='Y' or (B_Ind ne 'Y' and pct_increase &amp;lt; 0.3) then do;
      if &amp;lt;date&amp;gt; LT  '01JAN2019'd 
      then  UFA=round(UFR*increase,0.01);
      else if P_code not in (107, 108,109,110)
              then  UFA=round(UFR*increase,0.01);  &lt;BR /&gt;      ..........   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Condition 2 is &lt;U&gt;&lt;STRONG&gt;unclear&lt;/STRONG&gt; &lt;/U&gt;- What do you mean by O_balance? is this a variable in work.eom data set ?&lt;/P&gt;
&lt;P&gt;Do you mean that&amp;nbsp;&lt;STRONG&gt;abs(opendate - O_balance) LE 5&lt;/STRONG&gt; ? or without ABS function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 14:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506306#M135704</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-10-21T14:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help me add 2 more conditions  - multiple if then do condtions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506373#M135735</link>
      <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please disregard my posting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definitions have changed and what I have posted earlier does not apply any longer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 09:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-add-2-more-conditions-multiple-if-then-do-condtions/m-p/506373#M135735</guid>
      <dc:creator>Timbim</dc:creator>
      <dc:date>2018-10-22T09:28:13Z</dc:date>
    </item>
  </channel>
</rss>

