<?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: SAS problem with Oracle dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161100#M41973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok So I think I was not very clear on my question.&lt;/P&gt;&lt;P&gt;There is no conversion happening here. I have imported data for both source and target in SAS and am now comparing them in SAS. But while importing data from oracle to SAS, one of the field values got changed. In orcale I had date, but after coming to SAS it became Timestamp.&lt;/P&gt;&lt;P&gt;Why is this happening ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Sep 2014 15:33:27 GMT</pubDate>
    <dc:creator>nikhilbajaj</dc:creator>
    <dc:date>2014-09-26T15:33:27Z</dc:date>
    <item>
      <title>SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161097#M41970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having problems with a very simple SQL query in SAS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;rsubmit;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table TEST_RESULT as &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select CAL_D &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from EDT01371_DATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;except&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select CAL_D&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from CSTDM011_DATE;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select count(*) from TEST_RESULT;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here source is db2 and target is oracle. They both are same but this query is still not giving 0 as result just because in SAS, the value in target is looking different than what it is actually in the orcale table.&lt;/P&gt;&lt;P&gt;Data in orcale looks like - '24-APR-08'&lt;/P&gt;&lt;P&gt;But the same value in SAS looks like -&amp;nbsp;&amp;nbsp; '24APR2008:00:00:00'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone provide a solution to my problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 02:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161097#M41970</guid>
      <dc:creator>nikhilbajaj</dc:creator>
      <dc:date>2014-09-26T02:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161098#M41971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oracle typically uses datetime while SAS has numeric variables that can be date or datetime variables which explains why the dates show as different, but I'm not clear as to how that comes into your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 02:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161098#M41971</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-26T02:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161099#M41972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The query is simple but your are mentioning a conversion for Oracle to db2 using sas.&lt;/P&gt;&lt;P&gt;That are a lot of converions being&amp;nbsp; involved. I do not see all those being defined (oracle db2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS date conversion is a scuccesful one. Get the documentational (access datatypes) background by:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#p06jk0u30uhuj5n18fqw9sxr25lk.htm&lt;/A&gt; (oracle)&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#p0w91q9gw74cthn12r20n81bqi2z.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#p0w91q9gw74cthn12r20n81bqi2z.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Fifth Edition&lt;/A&gt; (db2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 06:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161099#M41972</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-26T06:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161100#M41973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok So I think I was not very clear on my question.&lt;/P&gt;&lt;P&gt;There is no conversion happening here. I have imported data for both source and target in SAS and am now comparing them in SAS. But while importing data from oracle to SAS, one of the field values got changed. In orcale I had date, but after coming to SAS it became Timestamp.&lt;/P&gt;&lt;P&gt;Why is this happening ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 15:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161100#M41973</guid>
      <dc:creator>nikhilbajaj</dc:creator>
      <dc:date>2014-09-26T15:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161101#M41974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The conversion are a result of different conventions at each environment.&lt;/P&gt;&lt;P&gt;Recognizing a data type for the several recognized types (see previous links) it will convert to the other side and adjust accordingly. It does that because of the meaning of the fields, you are not interested in the bit-bytes to interpreted them to symbols like the machines are trying to do that for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 16:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161101#M41974</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-26T16:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161102#M41975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oracle stores its date types as Date Times but shows them as dates:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt;The &lt;/SPAN&gt;&lt;CODE style="font-size: 12px; color: #222222; background-color: #ffffff;"&gt;DATE&lt;/CODE&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt; datatype stores point-in-time values (dates and times) in a table. The &lt;/SPAN&gt;&lt;CODE style="font-size: 12px; color: #222222; background-color: #ffffff;"&gt;DATE&lt;/CODE&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt; datatype stores the year (including the century), the month, the day, the hours, &lt;EM&gt;&lt;STRONG&gt;the minutes, and the seconds (after midnight).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt;&lt;A href="http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT413" title="http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT413"&gt;Oracle Data Types&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt;SAS has two different date types, dates and date times. Since the Oracle value matches the SAS date time value it shows it as a date time value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: Tahoma, sans-serif;"&gt;You can format it to show differently if you wish, using the appropriate SAS format or convert it to an actual date value using the datepart() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: Tahoma, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: Tahoma, sans-serif;"&gt;e.g. of formatting to look like a date:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: Tahoma, sans-serif;"&gt;format datevar dtdate9. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 10pt; background-color: #ffffff; font-family: Tahoma, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Tahoma, sans-serif; font-size: small; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 17:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161102#M41975</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-26T17:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161103#M41976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you are comparing dates to datetimes.&lt;/P&gt;&lt;P&gt;You could apply the DATEPART() function to convert the datetime values from Oracle into dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table from_oracle as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select datepart(cal_d) format = date9. &lt;/P&gt;&lt;P&gt;&amp;nbsp; from connection to oracle (select cal_d from myschema.mytable )&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;create table from_db as &lt;/P&gt;&lt;P&gt;&amp;nbsp; select cal_d format = date9.&lt;/P&gt;&lt;P&gt;&amp;nbsp; from connection to db2 (select cal_d from mydb.mytable )&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 18:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161103#M41976</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-26T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS problem with Oracle dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161104#M41977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this is my final query-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table TEST_RESULT as &lt;BR /&gt;select put(CAL_D,date9.)&lt;BR /&gt;from EDT01371_DATE&lt;BR /&gt;where CAL_Y &amp;gt; 2007 &lt;BR /&gt;and CAL_Y &amp;lt; 2016&lt;/P&gt;&lt;P&gt;except all&lt;/P&gt;&lt;P&gt;select put(CAL_D,dtdate9.)&lt;BR /&gt;from CSTDM011_DATE&lt;BR /&gt;where D_DIM_ID_N not in (0,1,2);&lt;BR /&gt;select count(*) from TEST_RESULT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for the efforts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 19:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-problem-with-Oracle-dates/m-p/161104#M41977</guid>
      <dc:creator>nikhilbajaj</dc:creator>
      <dc:date>2014-09-26T19:59:24Z</dc:date>
    </item>
  </channel>
</rss>

