<?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: Sas Date conversion to date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697121#M213024</link>
    <description>&lt;P&gt;First of all, do not (as in&amp;nbsp;&lt;STRONG&gt;NOT&lt;/STRONG&gt;) use two-digit years, or formats that display only 2 year digits for dates. It only causes confusion, for no gain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you got the raw Excel value in a date, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'30dec1899'd&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to it, and you'll get the correct date in SAS.&lt;/P&gt;
&lt;P&gt;This value covers three things:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Excel starts (nominally, see 3.) at 1900-01-01, SAS starts at 1960-01-01&lt;/LI&gt;
&lt;LI&gt;Excel starts with day 1, SAS with day 0&lt;/LI&gt;
&lt;LI&gt;Excel has a bug that makes it consider 1900 a leap year&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Fri, 06 Nov 2020 12:06:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-06T12:06:57Z</dc:date>
    <item>
      <title>Sas Date conversion to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697101#M213023</link>
      <description>While doing proc import of ab xlsx file sas converts short date to sas date format in character and unable convert it in date format. E.g.- date in excel- 10/4/2019. After proc import date- 43742 in char. After converting it to date with this code: format date_1 mmddyy8.;&lt;BR /&gt;Date_1=date; the output date_1=10/05/79. Any help?</description>
      <pubDate>Fri, 06 Nov 2020 10:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697101#M213023</guid>
      <dc:creator>Nehanzh</dc:creator>
      <dc:date>2020-11-06T10:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Date conversion to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697121#M213024</link>
      <description>&lt;P&gt;First of all, do not (as in&amp;nbsp;&lt;STRONG&gt;NOT&lt;/STRONG&gt;) use two-digit years, or formats that display only 2 year digits for dates. It only causes confusion, for no gain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you got the raw Excel value in a date, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'30dec1899'd&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to it, and you'll get the correct date in SAS.&lt;/P&gt;
&lt;P&gt;This value covers three things:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Excel starts (nominally, see 3.) at 1900-01-01, SAS starts at 1960-01-01&lt;/LI&gt;
&lt;LI&gt;Excel starts with day 1, SAS with day 0&lt;/LI&gt;
&lt;LI&gt;Excel has a bug that makes it consider 1900 a leap year&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 06 Nov 2020 12:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697121#M213024</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-06T12:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Date conversion to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697123#M213026</link>
      <description>&lt;P&gt;I'm sending you a link to a post talking about conversion from Excel dates to SAS dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Conversion-from-Excel-Date-to-SAS-Date/td-p/475824" target="_blank"&gt;https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Conversion-from-Excel-Date-to-SAS-Date/td-p/475824&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can use&amp;nbsp; SAS_date = Excel_date - 21916;&amp;nbsp; to convert your Excel date to a SAS date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just one thing, you'll have to convert your character variable "date" to a numeric variable using INPUT (eg:&amp;nbsp;numeric_date = input(date, 8.))&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 12:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Date-conversion-to-date-format/m-p/697123#M213026</guid>
      <dc:creator>jarapoch</dc:creator>
      <dc:date>2020-11-06T12:10:31Z</dc:date>
    </item>
  </channel>
</rss>

