<?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: proc sql to oracle specific date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191492#M48185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're only selecting three variables to group by but your grouping by 4.&amp;nbsp; Not sure if that's by design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other issue with oracle is that I believe SAS considers most oracle date columns (at least all of ours) to be datetime, not date...so you would have to use '01Jan2013:0:0'dt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 12:31:08 GMT</pubDate>
    <dc:creator>DBailey</dc:creator>
    <dc:date>2014-10-21T12:31:08Z</dc:date>
    <item>
      <title>proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191488#M48181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all, &lt;/P&gt;&lt;P&gt;can someone please help!&lt;/P&gt;&lt;P&gt;I can't figure out how to pull data for a specific date. &lt;/P&gt;&lt;P&gt;I am trying to query oracle database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noerrorstop;&lt;/P&gt;&lt;P&gt;connect to oracle (user='XX' password='XX' buffsize=100 path='XX'); &lt;/P&gt;&lt;P&gt;create table work.CUST as &lt;/P&gt;&lt;P&gt;select DATA_DT, EMPL_ID, CUST_NBR, Count(CUST_NBR) &lt;/P&gt;&lt;P&gt;from connection to oracle (select * from MYTABLE)&lt;/P&gt;&lt;P&gt;where DATA_DT = dmy(01, 01, 2013) and EMPL_ID in (select * from work.empls);&lt;/P&gt;&lt;P&gt;group by 1, 2, 3, 4;&lt;/P&gt;&lt;P&gt;disconnect from oracle;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get error for the above:&lt;/P&gt;&lt;P&gt;ERROR: The original SQL statement contains a UDF that is not being passed down to the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL execution is stopped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;P&gt;many thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 20:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191488#M48181</guid>
      <dc:creator>ivs</dc:creator>
      <dc:date>2014-10-20T20:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191489#M48182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noerrorstop;&lt;/P&gt;&lt;P&gt;connect to oracle (user='XX' password='XX' buffsize=100 path='XX'); &lt;/P&gt;&lt;P&gt;create table work.CUST as &lt;/P&gt;&lt;P&gt;select DATA_DT, EMPL_ID, CUST_NBR, Count(CUST_NBR) &lt;/P&gt;&lt;P&gt;from connection to oracle (select * from MYTABLE)&lt;/P&gt;&lt;P&gt;where DATA_DT = &lt;STRONG&gt;'01JAN2013'd&lt;/STRONG&gt; and EMPL_ID in (select &lt;STRONG&gt;EMPL_ID&lt;/STRONG&gt; from work.empls)&lt;/P&gt;&lt;P&gt;group by 1, 2, 3, 4;&lt;/P&gt;&lt;P&gt;disconnect from oracle;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 20:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191489#M48182</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-20T20:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191490#M48183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use explicit pass-thru.&lt;/P&gt;&lt;P&gt;In your case, SAS handles the date conversion for you AND pushes part of the where clause to the RDBMS if you use implicit pass-thru (that is, query a Oracle libname instead).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 20:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191490#M48183</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-10-20T20:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191491#M48184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to stat@sas:&lt;/P&gt;&lt;P&gt;this format gets no error messages, but the query hangs up with no results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to LinusH: &lt;BR /&gt;thanks! gonna try it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 21:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191491#M48184</guid>
      <dc:creator>ivs</dc:creator>
      <dc:date>2014-10-20T21:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191492#M48185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're only selecting three variables to group by but your grouping by 4.&amp;nbsp; Not sure if that's by design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other issue with oracle is that I believe SAS considers most oracle date columns (at least all of ours) to be datetime, not date...so you would have to use '01Jan2013:0:0'dt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 12:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191492#M48185</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-10-21T12:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql to oracle specific date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191493#M48186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to LinusH: The libname approach worked! Thank you!&lt;/P&gt;&lt;P&gt;to DBailey: its just a minor typo there - thanks for pointing this out. LinusH's answer resolved the fundamental problem.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 17:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-to-oracle-specific-date/m-p/191493#M48186</guid>
      <dc:creator>ivs</dc:creator>
      <dc:date>2014-10-21T17:54:33Z</dc:date>
    </item>
  </channel>
</rss>

