<?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: Need to understand what if/then statement is doing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762452#M241429</link>
    <description>&lt;P&gt;As I understand it, the IF condition is true if (start_dt + ii -1) is between the values of (filldates(i)) and (filldates(i)+days_supply(i)-1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The lack of brackets in this expression is concerning and would make it easier to read:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if filldates(i) &amp;lt;= (start_dt + ii -1) &amp;lt;= (filldates(i)+days_supply(i)-1)
		then daydummy(ii)=1;
		end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 04:08:55 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-08-19T04:08:55Z</dc:date>
    <item>
      <title>Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762447#M241424</link>
      <description>&lt;P&gt;I have this piece of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if filldates(i)&amp;lt;= start_dt + ii -1 &amp;lt;= filldates(i)+days_supply(i)-1
		then daydummy(ii)=1;
		end;&lt;/PRE&gt;
&lt;P&gt;Can someone help me understand what the IF statement is checking? There doesn't seem to be an AND or an OR operator, but two conditional operators (&amp;lt;=).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 03:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762447#M241424</guid>
      <dc:creator>alaxman</dc:creator>
      <dc:date>2021-08-19T03:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762452#M241429</link>
      <description>&lt;P&gt;As I understand it, the IF condition is true if (start_dt + ii -1) is between the values of (filldates(i)) and (filldates(i)+days_supply(i)-1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The lack of brackets in this expression is concerning and would make it easier to read:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if filldates(i) &amp;lt;= (start_dt + ii -1) &amp;lt;= (filldates(i)+days_supply(i)-1)
		then daydummy(ii)=1;
		end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 04:08:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762452#M241429</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-08-19T04:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762454#M241431</link>
      <description>&lt;P&gt;A &amp;lt; B &amp;lt; C is shorthand for A&amp;lt;B AND B&amp;lt;C.&lt;/P&gt;
&lt;P&gt;I assume that&amp;nbsp;filldates and&amp;nbsp;days_supply are array names and i is the index into the array.&amp;nbsp; Although they could be user defined functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stick your condition into a WHERE statement and SAS will show you how it is interpreted in the LOG.&lt;/P&gt;
&lt;PRE&gt;908   data _null_;
909     set sashelp.class;
910     where AGE &amp;lt;= HEIGHT &amp;lt;= WEIGHT ;
911   run;

NOTE: There were 18 observations read from the data set SASHELP.CLASS.
     &lt;STRONG&gt; WHERE (AGE&amp;lt;=HEIGHT) and (HEIGHT&amp;lt;=WEIGHT);
&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Aug 2021 04:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762454#M241431</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-19T04:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762557#M241457</link>
      <description>Thank you!</description>
      <pubDate>Thu, 19 Aug 2021 14:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762557#M241457</guid>
      <dc:creator>alaxman</dc:creator>
      <dc:date>2021-08-19T14:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762590#M241472</link>
      <description>&lt;P&gt;It means start_dt + ii -1 is &amp;gt;= filldates(i) AND start_dt + ii - 1 is &amp;lt;= filldates(i) + days_supply(i)-1.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 16:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762590#M241472</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-08-19T16:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand what if/then statement is doing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762749#M241523</link>
      <description>Thank you!</description>
      <pubDate>Fri, 20 Aug 2021 03:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-understand-what-if-then-statement-is-doing/m-p/762749#M241523</guid>
      <dc:creator>alaxman</dc:creator>
      <dc:date>2021-08-20T03:41:51Z</dc:date>
    </item>
  </channel>
</rss>

