<?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: Change to Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567296#M159516</link>
    <description>&lt;P&gt;Simply apply an appropriate format. However, I fail to see how 43586 in any format can be 5/1/2019? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   date=43586;
   format date mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Jun 2019 14:25:44 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-06-19T14:25:44Z</dc:date>
    <item>
      <title>Change to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567287#M159511</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS internal Date format for&amp;nbsp;5/1/2019 is 43586.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anybody suggest, How to convert 43586 back to 5/1/2019 after importing ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 14:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567287#M159511</guid>
      <dc:creator>jaiganesh</dc:creator>
      <dc:date>2019-06-19T14:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567296#M159516</link>
      <description>&lt;P&gt;Simply apply an appropriate format. However, I fail to see how 43586 in any format can be 5/1/2019? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   date=43586;
   format date mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 14:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567296#M159516</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-19T14:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567297#M159517</link>
      <description>&lt;P&gt;Can you please provide some additional details/logic regarding the importing of this data? This&amp;nbsp;is&amp;nbsp;so that we can have a better understanding of what is taking place, which in turn&amp;nbsp;will allow us to provide a better answer to your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 14:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567297#M159517</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-06-19T14:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567305#M159521</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240933"&gt;@jaiganesh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;SAS internal Date format for&amp;nbsp;5/1/2019 is 43586.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nope. This looks much more like an &lt;EM&gt;Excel&lt;/EM&gt; date (i.e. number of days after 31 Dec 1899, but including the non-existent 29 Feb 1900 -- known bug in Excel -- hence the 4358&lt;STRONG&gt;5&lt;/STRONG&gt; below):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysevalf('01MAY2019'd-'31DEC1899'd); /* result: 43585 */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, you'd need to subtract the "magic" number 21916 (=Excel date for SAS date 0, i.e. '01JAN1960'd) to arrive at a SAS date value, e.g., 21670 for 1 May 2019. (Search for "21916" in this forum and you'll find related discussions, e.g., this:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-for-date-format-check/td-p/298030" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-for-date-format-check/td-p/298030&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 14:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-to-Date/m-p/567305#M159521</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-06-19T14:48:29Z</dc:date>
    </item>
  </channel>
</rss>

