<?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 Oracle date into sas date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37244#M7357</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I copied a file from Oracle to SAS. &lt;BR /&gt;
There is a date field in the data set which is a numeric field with format and informat 23.  &lt;BR /&gt;
&lt;BR /&gt;
I tried checking like  '01OCT2009'D but this doest work.&lt;BR /&gt;
Please let me know if there is any way to convert this field into sas date.</description>
    <pubDate>Fri, 18 Jun 2010 06:07:20 GMT</pubDate>
    <dc:creator>SASACC</dc:creator>
    <dc:date>2010-06-18T06:07:20Z</dc:date>
    <item>
      <title>Oracle date into sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37244#M7357</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I copied a file from Oracle to SAS. &lt;BR /&gt;
There is a date field in the data set which is a numeric field with format and informat 23.  &lt;BR /&gt;
&lt;BR /&gt;
I tried checking like  '01OCT2009'D but this doest work.&lt;BR /&gt;
Please let me know if there is any way to convert this field into sas date.</description>
      <pubDate>Fri, 18 Jun 2010 06:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37244#M7357</guid>
      <dc:creator>SASACC</dc:creator>
      <dc:date>2010-06-18T06:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle date into sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37245#M7358</link>
      <description>The conversion should have been made for you if the Oracle date was identified as such and you used PROC IMPORT or the ORACLE engine.&lt;BR /&gt;
&lt;BR /&gt;
I think that Oracle bases its dates on 1jan1900.  It is possible therefore that your date is 60 years worth of days too big.  if this is the case the correction is:  &lt;BR /&gt;
&lt;BR /&gt;
date = date+'01jan1900'd;</description>
      <pubDate>Fri, 18 Jun 2010 06:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37245#M7358</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-06-18T06:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle date into sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37246#M7359</link>
      <description>the proper solution depends on "how" you copied that data.&lt;BR /&gt;
However, try a date-time format like datetime, or (if you expected only date information) DTDATE.&lt;BR /&gt;
&lt;BR /&gt;
most of the database interfaces to SAS collect date information as a datetime value</description>
      <pubDate>Fri, 18 Jun 2010 07:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37246#M7359</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-06-18T07:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle date into sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37247#M7360</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
Unlike SAS Oracle has a lot of different field types.&lt;BR /&gt;
&lt;BR /&gt;
If the field type in Oracle is date or datetime then it should translate correctly to a SAS datetime format.&lt;BR /&gt;
&lt;BR /&gt;
What I've seen already is that people store a date in a numeric field (as a number and not as a date), let's say 20100618.&lt;BR /&gt;
If this is the case then SAS can't know that this field should be interpreted as a date but reads it simply as a number. If you want to convert such a field to a date or datetime then you have to either do this in SAS (with format, informat) or if you're using pass through SQL you can also convert the field already in Oracle using the appropriate formats there.&lt;BR /&gt;
&lt;BR /&gt;
I believe to remember that in Oracle dates start from 1January1970.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Fri, 18 Jun 2010 12:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Oracle-date-into-sas-date/m-p/37247#M7360</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-06-18T12:20:56Z</dc:date>
    </item>
  </channel>
</rss>

