<?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: Case statement with Dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732553#M228275</link>
    <description>Move your NULL condition to the start since SAS considers missing values as the lowest numeric value.</description>
    <pubDate>Fri, 09 Apr 2021 16:35:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-04-09T16:35:42Z</dc:date>
    <item>
      <title>Case statement with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732541#M228267</link>
      <description>&lt;P&gt;I have a table of records with a Start Date and an Entered Date (SOENTD). I have the below case statement to populate a field based on the the START_DT values or lacktherof. Problem is that the Nul Start Dates are not being registered and are defaulting to 'Existing' when they should be 'N/A'&lt;/P&gt;
&lt;P&gt;Do I need to use Coalesce in this to do what I need it to? Any help is appreciated. Thank You!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;update TBL_EX&lt;/P&gt;
&lt;P&gt;set DATA_IND = case when START_DT &amp;gt;= SOENTD then 'New'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when START_DT &amp;lt; SOENTD then 'Existing'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;when START_DT is null then 'N/A'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 16:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732541#M228267</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2021-04-09T16:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732545#M228270</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when START_DT &amp;gt;= SOENTD then 'New'
when START_DT &amp;lt; SOENTD and not missing(start_dt) then 'Existing'
when START_DT is null then 'N/A'
end&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Missing values are considered to be less than non-missing values, that's why your original code doesn't work. It has nothing to do with the fact that the variables contain date values.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 16:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732545#M228270</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-09T16:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732553#M228275</link>
      <description>Move your NULL condition to the start since SAS considers missing values as the lowest numeric value.</description>
      <pubDate>Fri, 09 Apr 2021 16:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-with-Dates/m-p/732553#M228275</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-09T16:35:42Z</dc:date>
    </item>
  </channel>
</rss>

