<?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: Having trouble with date formatting when importing from Oracle Database using Proc SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95307#M26974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please provide date sample that appear in oracle...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jul 2013 05:44:30 GMT</pubDate>
    <dc:creator>sugeshnambiar</dc:creator>
    <dc:date>2013-07-31T05:44:30Z</dc:date>
    <item>
      <title>Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95304#M26971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using Proc SQL to query an oracle database.&amp;nbsp; I have a date that comes through as a datetime20.&amp;nbsp; When I convert it to a SAS data, the numeric value of that data is 10 digits long.&amp;nbsp; Given that the dates are all in the past few years, the numeric value should be around 18000 (ex 4/13/2009 minus 1/1/1960 is 18000).&amp;nbsp; How do I get the date from Oracle to accurately be reflected in SAS?&amp;nbsp; My code is at work (I'm at home now), but it generally looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE TABLE APPT AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT A.DATE FORMAT datew. FROM LIB.APPOINTMENT);&lt;/P&gt;&lt;P&gt; QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example value in the field "Appointment" is 1080844400'.&amp;nbsp; Why is it 10 digits long?&amp;nbsp; The actual dates are recent, so should they all be around five digits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 03:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95304#M26971</guid>
      <dc:creator>teg_76</dc:creator>
      <dc:date>2013-07-31T03:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95305#M26972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have the date in datetime still, so its really in seconds I think. You can use the datepart function to get only the date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select datepart(a.date) as date format date9. ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 04:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95305#M26972</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-31T04:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95306#M26973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you can provide your own format irrespective whatever date format you are reading, like use anydtdte. informat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input date anydtdte.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;28MAY1927:00:00:00&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 04:50:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95306#M26973</guid>
      <dc:creator>Tushar</dc:creator>
      <dc:date>2013-07-31T04:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95307#M26974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please provide date sample that appear in oracle...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 05:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95307#M26974</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-07-31T05:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95308#M26975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please review: &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/66690/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/66690/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Second Edition&lt;/A&gt; (Data Types for Oracle)&lt;/P&gt;&lt;P&gt;Oracle is using datetime (char) as date fields. Conversions SAS to Oracel vice/versa must support this conversion. Give the needed addtional information to all procedures and steps including formats (SAS). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SAS is using datetime as equivalent being the number of seconds since 1 jan 1960. &lt;/P&gt;&lt;P&gt;DBTYPE and DBSASTYPE can help in overwrite automatic conversions&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 07:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95308#M26975</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-07-31T07:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with date formatting when importing from Oracle Database using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95309#M26976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your help!&amp;nbsp; I really appreciate it!&amp;nbsp; Nice and simple solution.&amp;nbsp; Thanks Reeza!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 15:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Having-trouble-with-date-formatting-when-importing-from-Oracle/m-p/95309#M26976</guid>
      <dc:creator>teg_76</dc:creator>
      <dc:date>2013-07-31T15:13:42Z</dc:date>
    </item>
  </channel>
</rss>

