<?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: ORA-01840: input value not long enough for date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483979#M286991</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Just Googling the error Oracle throws: It could be that the data types of the columns you're using are not all of type DATE and that some implicit conversion is happening. If&amp;nbsp;such implicit conversion is going on then Oracle will use the format as set in &lt;SPAN&gt;NLS_DATE_FORMAT.&amp;nbsp;If this format doesn't match the string it's trying to convert then you could get the Oracle error you observing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Following this thought: It's possible that NLS_DATE_FORMAT has a different value depending on how you connect to Oracle (via SAS or SQL Developer).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What I would do:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Check if all your data types are DATE&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. If not all columns of type DATE: Cast strings to date using an explicit format using the to_date() function. Don't rely on implicit conversions.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Aug 2018 05:40:24 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-08-04T05:40:24Z</dc:date>
    <item>
      <title>ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483825#M286984</link>
      <description>&lt;P&gt;case when status not in ('Cancelled', 'Closed', 'Filled' ) then sysdate&lt;BR /&gt;when date_filled &amp;lt; date_req_approved then date_last_status_change else coalesce(date_filled, date_last_status_change)&lt;BR /&gt;end as date_filled&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue is with sysdate.&lt;/P&gt;&lt;P&gt;ERROR: CLI cursor fetch error: [Oracle][ODBC][Ora]ORA-01840: input value not long enough for date format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions how to make this work?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 15:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483825#M286984</guid>
      <dc:creator>ashwini2</dc:creator>
      <dc:date>2018-08-03T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483837#M286985</link>
      <description>&lt;P&gt;Are you running pass through. This is more of oracle question but one thing is for sure. columns you are comparing or in coalesce do not have same formats&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 15:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483837#M286985</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-08-03T15:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483841#M286986</link>
      <description>&lt;P&gt;I am running a passthrough. Weirdly my code works just fine in Oracle SQL.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 16:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483841#M286986</guid>
      <dc:creator>ashwini2</dc:creator>
      <dc:date>2018-08-03T16:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483845#M286987</link>
      <description>&lt;P&gt;Are you running an explicit sql pass through(via connect statement) or an implicit&amp;nbsp;sql&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 16:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483845#M286987</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-08-03T16:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483854#M286988</link>
      <description>&lt;P&gt;How is columns sysdate populated? Does it have the same attributes as&amp;nbsp;&lt;SPAN&gt;date_filled, date_req_approved, date_last_status_change?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 16:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483854#M286988</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-03T16:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483855#M286989</link>
      <description>&lt;P&gt;I am using the connect statement&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;connect to odbc as ods&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 16:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483855#M286989</guid>
      <dc:creator>ashwini2</dc:creator>
      <dc:date>2018-08-03T16:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483937#M286990</link>
      <description>&lt;P&gt;if it has worked in oracle sql developer and not working in connect statement. This might be any issue with ODBC connection related issue.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 22:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483937#M286990</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-08-03T22:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483979#M286991</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Just Googling the error Oracle throws: It could be that the data types of the columns you're using are not all of type DATE and that some implicit conversion is happening. If&amp;nbsp;such implicit conversion is going on then Oracle will use the format as set in &lt;SPAN&gt;NLS_DATE_FORMAT.&amp;nbsp;If this format doesn't match the string it's trying to convert then you could get the Oracle error you observing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Following this thought: It's possible that NLS_DATE_FORMAT has a different value depending on how you connect to Oracle (via SAS or SQL Developer).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What I would do:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Check if all your data types are DATE&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. If not all columns of type DATE: Cast strings to date using an explicit format using the to_date() function. Don't rely on implicit conversions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 05:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/483979#M286991</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-08-04T05:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: ORA-01840: input value not long enough for date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/484414#M286992</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Make sure that all these variable(sysdate,&amp;nbsp;date_last_status_change,&amp;nbsp;date_filled,&amp;nbsp;date_last_status_change) have same date or datetime formats.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If your sysdate is&amp;nbsp;'DD/MM/YYYY 00:00:00' format and&amp;nbsp;date_last_status_change is&amp;nbsp;'DD/MM/YYYY' format, then you might get this possible error. Convert them to same format using TO_DATE() in Oracle or convert them all to characters using TO_CHAR.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 15:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ORA-01840-input-value-not-long-enough-for-date-format/m-p/484414#M286992</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-08-06T15:24:34Z</dc:date>
    </item>
  </channel>
</rss>

