<?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: How to read a 3 digit year? Invalid date/time/datetime constant in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867489#M342621</link>
    <description>&lt;P&gt;Are you&amp;nbsp;&lt;STRONG&gt;really sure&lt;/STRONG&gt; you have to deal with dates in the 3rd century AD? Or is this simply an error in the data caused by some kind of truncation?&lt;/P&gt;
&lt;P&gt;If this are real dates, you need to dissect (SUBSTR) them upon reading and store them as separate day, month and year variables.&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 16:04:12 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-31T16:04:12Z</dc:date>
    <item>
      <title>How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867475#M342615</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am working with the code below and I'm getting the error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;29 datestr='12Mar202'd;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;___________&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;77&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;ERROR: Invalid date/time/datetime constant '12Mar202'd.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;ERROR 77-185: Invalid number conversion on '12Mar202'd.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;30 datestr2='12Mar0202'd;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;____________&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;77&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;ERROR: Invalid date/time/datetime constant '12Mar0202'd.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FF0000"&gt;ERROR 77-185: Invalid number conversion on '12Mar0202'd.&lt;/FONT&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
datestr='12Mar202'd;
datestr2='12Mar0202'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know why SAS doesn't accept a 3 digit year.&amp;nbsp;Is there a way to read 3 digit year in SAS?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thank you in advance for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867475#M342615</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2023-03-31T15:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867478#M342616</link>
      <description>&lt;P&gt;If you mean the year 202 which was over 1,800 years ago, I don't think SAS can work with calendars that far in the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean something else, then explain what 202 means.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867478#M342616</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-31T15:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867481#M342617</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
datestr='01JAN1581'd;
datestr2='01JAN1582'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Yes, that's it, it's the year 202.&lt;BR /&gt;I just did a test, and the error shows up from 1581.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867481#M342617</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2023-03-31T15:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867482#M342618</link>
      <description>&lt;P&gt;Yes, the Gregorian Calendar went into effect on 15 October 1582, which I think is the earliest date that SAS can handle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although the tell you the truth, I am surprised anyone needs a date of 12MAR202 in SAS, as there are so few historical records from back then to indicate something happened on a specific date.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867482#M342618</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-31T15:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867486#M342619</link>
      <description>&lt;P&gt;Yes, I agree with you.&lt;BR /&gt;I need to import the data into a file.&lt;BR /&gt;There is a date field, and in this field there are year values &amp;lt; 1582.&lt;BR /&gt;Certainly, there are errors or incidents to report.&lt;BR /&gt;But I want to know if there is a solution to circumvent it.&lt;BR /&gt;Because this SAS error will block what I want to do next.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867486#M342619</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2023-03-31T15:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867489#M342621</link>
      <description>&lt;P&gt;Are you&amp;nbsp;&lt;STRONG&gt;really sure&lt;/STRONG&gt; you have to deal with dates in the 3rd century AD? Or is this simply an error in the data caused by some kind of truncation?&lt;/P&gt;
&lt;P&gt;If this are real dates, you need to dissect (SUBSTR) them upon reading and store them as separate day, month and year variables.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 16:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867489#M342621</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-31T16:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a 3 digit year? Invalid date/time/datetime constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867501#M342631</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235012"&gt;@kelxxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, I agree with you.&lt;BR /&gt;I need to import the data into a file.&lt;BR /&gt;There is a date field, and in this field there are year values &amp;lt; 1582.&lt;BR /&gt;Certainly, there are errors or incidents to report.&lt;BR /&gt;But I want to know if there is a solution to circumvent it.&lt;BR /&gt;Because this SAS error will block what I want to do next.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One of the reasons that SAS only accepts date after 1582 is because calendars were not very standard. And subject to change frequently and by geography. A date of "1 March" in one country could be in February or days later in another.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you actually have data that goes back that far I would parse your date to Day, Month and Year values.&lt;/P&gt;
&lt;P&gt;If you are going to try to do any interval calculations good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 16:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-3-digit-year-Invalid-date-time-datetime-constant/m-p/867501#M342631</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-31T16:32:43Z</dc:date>
    </item>
  </channel>
</rss>

