<?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: &amp;quot;Between&amp;quot; logic in IF statement in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889369#M43474</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443295"&gt;@Stepik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;When I try to set the next condition on the if statement that determines the value between 2 numbers, the result unfortunately does not take this condition into account and calculates it as there would be no such a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if ke ne 1 and sales = 0 and &lt;FONT color="#800080"&gt;(0 &amp;lt; other &amp;lt; 50000000)&lt;/FONT&gt; then do;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You haven't told us what you see in the output that seems to be incorrect. What do you see that you think is incorrect? Please be specific. Also please show us sample data.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 15:06:30 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-08-15T15:06:30Z</dc:date>
    <item>
      <title>"Between" logic in IF statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889356#M43470</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;When I try to set the next condition on the if statement that determines the value between 2 numbers, the result unfortunately does not take this condition into account and calculates it as there would be no such a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if ke ne 1 and sales = 0 and &lt;FONT color="#800080"&gt;(0 &amp;lt; other &amp;lt; 50000000)&lt;/FONT&gt; then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Stefan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889356#M43470</guid>
      <dc:creator>Stepik</dc:creator>
      <dc:date>2023-08-15T14:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Between</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889357#M43471</link>
      <description>&lt;P&gt;Why not just omit the "between" logic and split into two conditions?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889357#M43471</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-08-15T14:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: "Between" logic in IF statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889365#M43472</link>
      <description>&lt;P&gt;This seems to work fine for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need to round/fuzz the 0 comparison?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
do ke=0,1;
do sales=0 to 4;
do other=1000000 to 8000000 by 1000000;
output;
end;
end;
end;
run;

data want;
set have;

 if ke ne 1 and sales = 0 and (0 &amp;lt; other &amp;lt; 50000000) then do;
 flag=1;
 end;
 else flag=0;
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889365#M43472</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-08-15T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: "Between" logic in IF statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889366#M43473</link>
      <description>&lt;P&gt;What does the code look like before the ELSE? You may never get to this "condition" because of prior code and values.&lt;/P&gt;
&lt;P&gt;What is the value of KE, Sales and OTHER?&lt;/P&gt;
&lt;P&gt;What is the calculation performed and values of the variables involved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No data, incomplete code, no actual evidence of incorrect anything in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do not chop stuff up and then expect us to mind read the contents of needed code and values of variables.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443295"&gt;@Stepik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;When I try to set the next condition on the if statement that determines the value between 2 numbers, the result unfortunately does not take this condition into account and calculates it as there would be no such a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if ke ne 1 and sales = 0 and &lt;FONT color="#800080"&gt;(0 &amp;lt; other &amp;lt; 50000000)&lt;/FONT&gt; then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Stefan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889366#M43473</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-15T14:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: "Between" logic in IF statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889369#M43474</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443295"&gt;@Stepik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;When I try to set the next condition on the if statement that determines the value between 2 numbers, the result unfortunately does not take this condition into account and calculates it as there would be no such a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if ke ne 1 and sales = 0 and &lt;FONT color="#800080"&gt;(0 &amp;lt; other &amp;lt; 50000000)&lt;/FONT&gt; then do;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You haven't told us what you see in the output that seems to be incorrect. What do you see that you think is incorrect? Please be specific. Also please show us sample data.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 15:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/quot-Between-quot-logic-in-IF-statement/m-p/889369#M43474</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-15T15:06:30Z</dc:date>
    </item>
  </channel>
</rss>

