<?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 with if/else statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295628#M61801</link>
    <description>Thank you so very much! That worked!</description>
    <pubDate>Wed, 31 Aug 2016 18:53:45 GMT</pubDate>
    <dc:creator>malikah_sph</dc:creator>
    <dc:date>2016-08-31T18:53:45Z</dc:date>
    <item>
      <title>Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295597#M61794</link>
      <description>&lt;P&gt;Can anyone provide some insight as to why this code is wrong:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data analytic4;&lt;BR /&gt;set analytic3;&lt;/P&gt;&lt;P&gt;if admitdif1 lt "30" OR admitdif1a lt "30" OR admitdif2 lt "30" OR admitdif2a lt "30" OR admitdif3 lt "30" OR admitdif3a lt "30"&lt;BR /&gt;OR admitdif4 lt "30" OR admitdif4a lt "30" OR admitdif5 lt "30" OR admitdif5a lt "30" OR admitdif6 lt "30" OR admitdif6a lt "30" then admit30day="1";&lt;/P&gt;&lt;P&gt;else admit30day="0";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the observations are coding as a "1"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 18:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295597#M61794</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-31T18:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295604#M61795</link>
      <description>&lt;P&gt;Provide some of your input data where you do not expect to get 1 for a result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A common issue when using LT or LE comparisons is forgetting that Missing values are &lt;STRONG&gt;always&lt;/STRONG&gt; less than any value. So if any of your variables is missing then that LT condition is true and would get the 1 assignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 18:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295604#M61795</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-31T18:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295617#M61797</link>
      <description>&lt;P&gt;The data set I have is temporary so I am not sure how I would send it to you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 18:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295617#M61797</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-31T18:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295622#M61799</link>
      <description>&lt;P&gt;See the comment above about missing values. It's highly likely this is the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the min function to get smallest non missing value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If Min(of admitdif1-admitdif6) &amp;lt; 30 then var=1;&lt;/P&gt;
&lt;P&gt;else var=0;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 18:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295622#M61799</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-31T18:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295625#M61800</link>
      <description>&lt;P&gt;Are your variables really character variables?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, making character comparisons is tricky.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if "100" &amp;lt; "30" then var=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This comparison is true.&amp;nbsp; As a character string, "100" is less than "30" because "1" is less than "3".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, as has been suggested, the first place to look is for missing values.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 18:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295625#M61800</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-31T18:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with if/else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295628#M61801</link>
      <description>Thank you so very much! That worked!</description>
      <pubDate>Wed, 31 Aug 2016 18:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-if-else-statement/m-p/295628#M61801</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-31T18:53:45Z</dc:date>
    </item>
  </channel>
</rss>

