<?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: Using missing values in an if statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866591#M342233</link>
    <description>Sorry about the semicolon. I hit POST and then realized it. Thank you for&lt;BR /&gt;the explanation. I have a multitude of similar if statements and now I&lt;BR /&gt;understand what they do.&lt;BR /&gt;Again, Thank You!&lt;BR /&gt;</description>
    <pubDate>Mon, 27 Mar 2023 17:58:30 GMT</pubDate>
    <dc:creator>somedayroy</dc:creator>
    <dc:date>2023-03-27T17:58:30Z</dc:date>
    <item>
      <title>Using missing values in an if statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866584#M342227</link>
      <description>&lt;P&gt;I have this code in SAS and don't know why it is comparing if missing is less than a value.&amp;nbsp; Is it to exclude the missing values?&amp;nbsp; What is the if statement doing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;precipday = precipitationdays_from_database_query;&lt;/P&gt;&lt;P&gt;if . lt precipday lt 0 then precipday = 0.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 17:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866584#M342227</guid>
      <dc:creator>somedayroy</dc:creator>
      <dc:date>2023-03-27T17:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using missing values in an if statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866588#M342230</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if . lt precipday lt 0 then precipday = 0.1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To be very picky, the line of code you provided will do nothing without a semi-colon on the end. So I added one there, I assume you're going to actually have a semi-colon on the end. Please provide us code examples with proper semi-colons from now on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The syntax , for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 60 &amp;lt; variablename &amp;lt; 80 then do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;compares the value of variable VARIABLENAME to 60 and 80 — and if 60 is less than this value and this value is less than 80, then the code tells SAS to do something. In your case, it compares the value of PRECIPDAY to missing and to zero and if missing is less than the value, and the value is less than 0, then SAS should do something, specifically set PRECIPDAY = 0.1. In SAS, missing values are considered to be less than any negative number. (Or to phrase it another way, negative number will have PRECIPDAY set to 0.1, but missings will not have PRECIPDAY set to 0.1, and positive numbers will not have PRECIPDAY set to 0.1)&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 17:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866588#M342230</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-27T17:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using missing values in an if statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866591#M342233</link>
      <description>Sorry about the semicolon. I hit POST and then realized it. Thank you for&lt;BR /&gt;the explanation. I have a multitude of similar if statements and now I&lt;BR /&gt;understand what they do.&lt;BR /&gt;Again, Thank You!&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Mar 2023 17:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-missing-values-in-an-if-statement/m-p/866591#M342233</guid>
      <dc:creator>somedayroy</dc:creator>
      <dc:date>2023-03-27T17:58:30Z</dc:date>
    </item>
  </channel>
</rss>

