<?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: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638454#M189857</link>
    <description>&lt;P&gt;Presumably your real code is using a libref that is using the ODBC engine and not the WORK dataset in your example code.&amp;nbsp; What does SAS show as the type of the variable? What format does SAS show as being attached to it?&amp;nbsp; Try running PROC CONTENTS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=mylib.huge_data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and check how PROD_DATE is defined.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Apr 2020 19:42:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-04-08T19:42:47Z</dc:date>
    <item>
      <title>ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638445#M189853</link>
      <description>&lt;P&gt;This is the error that I am continually receiving as I attempt to pull data from a very large data set &lt;FONT color="#0000FF"&gt;(ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format).&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I am not sure, there maybe an error in the data - but the dataset is too large for me to investigate, but there is also the chance that it may be the date/time format that I am unable to query.&amp;nbsp; I have tried several formats including the following codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data wish;&lt;/P&gt;&lt;P&gt;set huge_data;&lt;/P&gt;&lt;P&gt;where prod_date = mdy(01,01,2020);&lt;/P&gt;&lt;P&gt;where prod_date = dhms(01JAN2020:00:00:00);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried a number of other things (pulling via proc sql, pulling based on &amp;gt; a date), but the process continues to bomb at some point (usually after a couple of hundred thousand records depending on which day I select - this makes me think it is an unexpected value in the data - but not sure).&amp;nbsp; Is there anyway to program around this type of error or something I need to do to avoid it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 19:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638445#M189853</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2020-04-08T19:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638454#M189857</link>
      <description>&lt;P&gt;Presumably your real code is using a libref that is using the ODBC engine and not the WORK dataset in your example code.&amp;nbsp; What does SAS show as the type of the variable? What format does SAS show as being attached to it?&amp;nbsp; Try running PROC CONTENTS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=mylib.huge_data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and check how PROD_DATE is defined.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 19:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638454#M189857</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-08T19:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638473#M189863</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;Thanks - you are correct.&amp;nbsp; The set statement should show a library (set server.huge_data) as the data resides on a server.&amp;nbsp; The data field 'Prod_date' is numeric, with a format &amp;amp; informat of Datetime20.&amp;nbsp; Length of 8.&amp;nbsp; I've been able to query small subsets of this data - but not when I try the all of the records from a particular date.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 20:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638473#M189863</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2020-04-08T20:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638477#M189865</link>
      <description>&lt;P&gt;Don't know about the ORACLE part but the DHMS function takes 4 parameters and you only have have. The parameters would be separated by commas and the DATE has to be a date literal or variable holding the date:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dhms('01JAN2020'd,00,00,00);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should have also gotten an error similar to :&lt;/P&gt;
&lt;PRE&gt;                   dhms(01JAN2020:00:00:00);
                        -------
                        388
                        76
ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.
&lt;/PRE&gt;
&lt;P&gt;Sometimes other errors may not be reported depending on the nature. If you did not see this error be prepared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 20:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638477#M189865</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-08T20:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638575#M189910</link>
      <description>&lt;P&gt;Have you tried this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where prod_date = '01JAN2020:00:00:00'dt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 04:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638575#M189910</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-09T04:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638651#M189925</link>
      <description>&lt;P&gt;sorry, I may not have listed my code appropriately for DT, but when I run this format (where prod_date = dhms('01JAN2020'd,00,00,00) I receive the same error message.&amp;nbsp; I am able to capture a little more than 300,000 records before the code bombs and gives me the error.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 12:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638651#M189925</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2020-04-09T12:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638652#M189926</link>
      <description>yes, same error. Is there anyway to get past this - like a 'force' statement or 'ignore'?</description>
      <pubDate>Thu, 09 Apr 2020 12:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638652#M189926</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2020-04-09T12:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: CLI cursor fetch error: [Oracle][ODBC]Invalid datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638654#M189927</link>
      <description>&lt;P&gt;Sounds like you might have an issue in the remote database.&amp;nbsp; &amp;nbsp;Sometimes people use extreme date values as an attempt to mimic a special missing value.&amp;nbsp; For example they might set an end date to some really large future date. Or a start date to some really old past date.&amp;nbsp; Or you could just have garbage dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you can use some other tests to try to find some examples of the vlaues that are generating the error?&amp;nbsp; Perhaps by filtering with other variables also and see if you can pinpoint which observations to look at.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 12:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-CLI-cursor-fetch-error-Oracle-ODBC-Invalid-datetime-format/m-p/638654#M189927</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-09T12:47:24Z</dc:date>
    </item>
  </channel>
</rss>

