<?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: Problem with Dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300678#M63543</link>
    <description>&lt;PRE&gt;
Maybe you could import these date into SAS as character (at SQL Server side)
and transform it into data by INPUT() .


&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Sep 2016 03:01:43 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-09-26T03:01:43Z</dc:date>
    <item>
      <title>Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300650#M63525</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working on on SQL Server Database, with a low date as 0001-01-01, While reading this data into SAS these values are shown a nulls or ***** can any one of you please help on this. One millions thanks well in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WIth regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ramana Potluri&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 21:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300650#M63525</guid>
      <dc:creator>VRPotluri</dc:creator>
      <dc:date>2016-09-25T21:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300671#M63539</link>
      <description>&lt;PRE&gt;
***  usually because length of format is too short, try assign a longer format 
Like format date date9.

Or remove that format and see what is going on in it .
proc print ;
format date;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 02:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300671#M63539</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-26T02:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300675#M63542</link>
      <description>&lt;P&gt;I have already tried this. This did not work.&lt;/P&gt;&lt;P&gt;My problem here any date prior to 1958-01-01 is reading as missing. How can I resolve this.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 02:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300675#M63542</guid>
      <dc:creator>VRPotluri</dc:creator>
      <dc:date>2016-09-26T02:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300678#M63543</link>
      <description>&lt;PRE&gt;
Maybe you could import these date into SAS as character (at SQL Server side)
and transform it into data by INPUT() .


&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 03:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300678#M63543</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-26T03:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300689#M63546</link>
      <description>&lt;P&gt;What is the column type in SQL Server? Datetime or something else? How are you reading SQL Server? SAS/ACCESS to SQL Server or ODBC?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 04:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300689#M63546</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-09-26T04:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300699#M63550</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30473"&gt;@VRPotluri&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I have already tried this. This did not work.&lt;/P&gt;
&lt;P&gt;My problem here any date prior to 1958-01-01 is reading as missing. How can I resolve this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That would be very strange, as SAS accepts dates back to the 16th century:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dateval = input(datestring,yymmdd10.);
format dateval yymmddd10.;
cards;
1960-01-01
1958-01-01
1850-01-01
1750-01-01
1690-01-01
1590-01-01
;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Obs    datestring       dateval

 1     1960-01-01    1960-01-01
 2     1958-01-01    1958-01-01
 3     1850-01-01    1850-01-01
 4     1750-01-01    1750-01-01
 5     1690-01-01    1690-01-01
 6     1590-01-01    1590-01-01
&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 06:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300699#M63550</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-26T06:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300769#M63575</link>
      <description>&lt;P&gt;Since I doubt that you have any actual values recorded for 0001-01-01 I suspect that exact value is being used as either a place holder or indicator for missing or invalid data. Due to vagaries of history and inconsistent calendars SAS does not support dates prior to the English adoption of the Gregorian calendar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you are looking at OUTPUT in Excel by any chance, Excel doesn't support dates prior to 1900.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 14:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Dates/m-p/300769#M63575</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T14:42:27Z</dc:date>
    </item>
  </channel>
</rss>

