<?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: Select from data values in case when in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702887#M215308</link>
    <description>&lt;P&gt;SAS dates&amp;nbsp;&lt;EM&gt;are&lt;/EM&gt; integers, counting the days from 1960-01-01. Apply a date format (like YYMMDD10.) to make them human-readable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why do you use that complicated CASE, when a simple COALESCE function would do it?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalesce(date_1,date_2) format=yymmdd10. as new_date&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Dec 2020 20:17:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-12-01T20:17:27Z</dc:date>
    <item>
      <title>Select from data values in case when</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702885#M215307</link>
      <description>&lt;P&gt;My code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table dataset_new as&lt;BR /&gt;SELECT m.*, case when date_1 is not null thendate_1 else date_2 end as new_date&lt;BR /&gt;from dataset_old m&lt;BR /&gt;left join joined_table c on m.id_prior =c.id&lt;BR /&gt;where 1=1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I go to the new_date column, the values are displayed as integers and not as dates. Please advise on how to proceed.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 20:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702885#M215307</guid>
      <dc:creator>aalluru</dc:creator>
      <dc:date>2020-12-01T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select from data values in case when</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702887#M215308</link>
      <description>&lt;P&gt;SAS dates&amp;nbsp;&lt;EM&gt;are&lt;/EM&gt; integers, counting the days from 1960-01-01. Apply a date format (like YYMMDD10.) to make them human-readable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why do you use that complicated CASE, when a simple COALESCE function would do it?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalesce(date_1,date_2) format=yymmdd10. as new_date&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2020 20:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702887#M215308</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-01T20:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select from data values in case when</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702888#M215309</link>
      <description>&lt;P&gt;now the output is just asterisk signs&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 20:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702888#M215309</guid>
      <dc:creator>aalluru</dc:creator>
      <dc:date>2020-12-01T20:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select from data values in case when</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702893#M215312</link>
      <description>&lt;P&gt;then you likely have a datetime, ie a time component is one each date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the DTDATE9. format or tell us what the format is on your original variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/355241"&gt;@aalluru&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;now the output is just asterisk signs&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 21:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702893#M215312</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-12-01T21:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select from data values in case when</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702895#M215313</link>
      <description>&lt;P&gt;Show us such a value without the format.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 21:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-from-data-values-in-case-when/m-p/702895#M215313</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-01T21:19:31Z</dc:date>
    </item>
  </channel>
</rss>

