<?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 Date out of range error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53965#M14947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dt=20120131;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test1;&lt;/P&gt;&lt;P&gt;Set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dt1=input(put(dt,8.),yymmdd10.);&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2012 14:42:31 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-15T14:42:31Z</dc:date>
    <item>
      <title>Date out of range error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53962#M14944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test;&lt;/P&gt;&lt;P&gt; Dt=201210131;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test1;&lt;/P&gt;&lt;P&gt;Set test;&lt;/P&gt;&lt;P&gt;Dt1=put(dt,yymmdd10.);&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the second data step I am getting an error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Date out of range"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share your thoughts on how to fix this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 04:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53962#M14944</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-02-15T04:03:26Z</dc:date>
    </item>
    <item>
      <title>Date out of range error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53963#M14945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct the data!&amp;nbsp; 2012 10 131?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 04:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53963#M14945</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-15T04:06:14Z</dc:date>
    </item>
    <item>
      <title>Date out of range error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53964#M14946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops..that was a typo,the date is 20120131.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 14:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53964#M14946</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-02-15T14:37:15Z</dc:date>
    </item>
    <item>
      <title>Date out of range error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53965#M14947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dt=20120131;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test1;&lt;/P&gt;&lt;P&gt;Set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dt1=input(put(dt,8.),yymmdd10.);&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 14:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/53965#M14947</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-15T14:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date out of range error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/739130#M80519</link>
      <description>&lt;P&gt;SAS treats dates as integer numbers with Day 0 being 1 January 1960, so when you assign the number 201210131, what are you intending the number to mean?&lt;/P&gt;
&lt;P&gt;The reason SAS gives the error is because the number that is assigned to variable DT is interpreted as the&amp;nbsp;201210131st day after 1 January 1960, which is more than half a million years in the future! I am guessing this is probably not what you meant. But what did you mean? Is this number 31 January 20121 - unlikely but possible - or 13 October 2012 - maybe - or did you intend to type 31 January 2012 but made a typo and inserted an extra digit in the middle of the number.&lt;/P&gt;
&lt;P&gt;To "fix this error" I would suggest you start by reading&amp;nbsp;&lt;A title="About SAS Date, Time, and Datetime Values" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p1wj0wt2ebe2a0n1lv4lem9hdc0v.htm" target="_blank" rel="noopener"&gt;about SAS Date, Time, and Datetime Values&lt;/A&gt;&amp;nbsp;in the documentation to first understand what the error is you are trying to fix. There you will find that SAS can only display&amp;nbsp;&lt;A title="Gregorian calendar (Wikipedia)" href="https://en.wikipedia.org/wiki/Gregorian_calendar" target="_blank" rel="noopener"&gt;Gregorian calendar&lt;/A&gt;&amp;nbsp; dates between 1582 and 19900. Also dates prior to September 1752 in British jurisdictions can be dual dated, while dates in other jurisdictions depend on when the calendar was adopted (Greece adopted the Gregorian calendar in 1923, for example.)&amp;nbsp; Once you understand how SAS represents dates, then search for various papers that explain how to deal with representing dates in SAS and the error you have encountered. There are plenty of solutions documented.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 02:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-out-of-range-error/m-p/739130#M80519</guid>
      <dc:creator>Cameron</dc:creator>
      <dc:date>2021-05-05T02:42:01Z</dc:date>
    </item>
  </channel>
</rss>

