<?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: DATETIME20 Format error on where clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342583#M78557</link>
    <description>&lt;P&gt;So you have an Oracle problem, not a SAS problem. Ask your Oracle people for assistance how to provide a timestamp literal, or consult the &lt;A href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm" target="_blank"&gt;Oracle documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I guess you should use&lt;/P&gt;
&lt;PRE&gt;TIMESTAMP '2013-01-01 00:00:01'&lt;/PRE&gt;
&lt;P&gt;instead of&lt;/P&gt;
&lt;PRE&gt;{ts '2013-01-01 00:00:01'}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 13:36:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-20T13:36:45Z</dc:date>
    <item>
      <title>DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342529#M78544</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run my SAS code with this where clause, my SAS errors&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AND XICQ_SUBACCOUNT_SUMMARY.XICQ_COMPLETION_DATE&amp;gt;={ts '2013-01-01 00:00:01'}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variable format&amp;nbsp;&lt;SPAN&gt;XICQ_COMPLETION_DATE&lt;/SPAN&gt; DATETIME20. and the output is like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;13AUG2004:00:00:00&lt;/P&gt;
&lt;P&gt;21MAY2004:00:00:00&lt;/P&gt;
&lt;P&gt;16AUG2004:00:00:00&lt;/P&gt;
&lt;P&gt;03JUN2004:00:00:00&lt;/P&gt;
&lt;P&gt;06MAY2004:00:00:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea how I can get this part of my where clause to work please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 10:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342529#M78544</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2017-03-20T10:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342545#M78550</link>
      <description>&lt;P&gt;using a proepr datetime constant will most likely solve the issue, but because you have not posted the error message, this is just guessed.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 12:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342545#M78550</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-03-20T12:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342551#M78552</link>
      <description>&lt;PRE&gt;{ts '2013-01-01 00:00:01'}&lt;/PRE&gt;
&lt;P&gt;is not a proper SAS datetime literal.&lt;/P&gt;
&lt;P&gt;The correct SAS notation would be&lt;/P&gt;
&lt;PRE&gt;'01jan2013:00:00:01'dt&lt;/PRE&gt;
&lt;P&gt;or you could use&lt;/P&gt;
&lt;PRE&gt;input('2013-01-01T00:00:01',e8601dt.)&lt;/PRE&gt;
&lt;P&gt;instead&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 12:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342551#M78552</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-20T12:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342581#M78556</link>
      <description>&lt;P&gt;This is my error message -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: ORACLE prepare error: ORA-00911: invalid character. SQL statement: SELECT ACCOUNTS.ACC_ACCOUNT_NO, &lt;BR /&gt; ACCOUNTS.ACC_PURPOSE_CODE, ACCOUNT_TYPES.ACT_LEVEL1_CODE, XICQ_SUBACCOUNT_SUMMARY.XICQ_COMPLETION_DATE, MAM34.CLIINCAMT, &lt;BR /&gt; MAM34.CLIINCFREQ, ACCOUNTS.ACC_ACTUAL_ADVANCE, MAM34.CLIINCTYP, MAM34.CLIINCSQ, MAM34.APPLSEQ, ACCOUNTS.ACC_SUBACC_NO, &lt;BR /&gt; MAM34.CLINUM FROM ACCOUNTS LEFT OUTER JOIN ACCOUNT_TYPES ON ACCOUNTS.ACC_ACT_CODE=ACCOUNT_TYPES.ACT_CODE LEFT OUTER JOIN &lt;BR /&gt; XICQ_SUBACCOUNT_SUMMARY ON (ACCOUNTS.ACC_ACCOUNT_NO=XICQ_SUBACCOUNT_SUMMARY.XICQ_ACCOUNT_NO) AND &lt;BR /&gt; (ACC_SUBACC_NO=XICQ_SUBACCOUNT_SUMMARY.XICQ_SUBACC_NO) LEFT OUTER JOIN MAM34 ON &lt;BR /&gt; XICQ_SUBACCOUNT_SUMMARY.XICQ_ACCOUNT_NO=MAM34.MORTGAGE WHERE MAM34.CLIINCTYP='REN' AND ACCOUNT_TYPES.ACT_LEVEL1_CODE='7' AND &lt;BR /&gt; ACCOUNTS.ACC_PURPOSE_CODE&amp;lt;&amp;gt;'FAD' AND XICQ_SUBACCOUNT_SUMMARY.XICQ_COMPLETION_DATE&amp;gt;={ts '2013-01-01 00:00:01'}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using these ut still didn't work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'01jan2013:00:00:01'dt&lt;/PRE&gt;
&lt;P&gt;or you could use&lt;/P&gt;
&lt;PRE&gt;input('2013-01-01T00:00:01',e8601dt.)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 13:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342581#M78556</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2017-03-20T13:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342583#M78557</link>
      <description>&lt;P&gt;So you have an Oracle problem, not a SAS problem. Ask your Oracle people for assistance how to provide a timestamp literal, or consult the &lt;A href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm" target="_blank"&gt;Oracle documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I guess you should use&lt;/P&gt;
&lt;PRE&gt;TIMESTAMP '2013-01-01 00:00:01'&lt;/PRE&gt;
&lt;P&gt;instead of&lt;/P&gt;
&lt;PRE&gt;{ts '2013-01-01 00:00:01'}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 13:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342583#M78557</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-20T13:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME20 Format error on where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342676#M78576</link>
      <description>&lt;P&gt;You need to be careful with DATE/TIMESTAMP's when moving between Oracle and SAS. &amp;nbsp;I don't recall exactly which off the top of my head, but I know that when moving between the two SAS interprets Oracle DATES or TIMESTAMPS as either SAS DATETIMES or CHAR's, I think there is also a difference between TIMESTAMP and TIMESTAMP WITH TIMEZONE and TIMESTAMP WITH LOCAL TIMEZONE, in whether SAS will treat it as a DATETIME or CHAR. &amp;nbsp;Also, Oracle does not have a concept of a pure date, even the DATE type includes a time component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that this type mismatch is causing your problems.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME20-Format-error-on-where-clause/m-p/342676#M78576</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2017-03-20T16:27:17Z</dc:date>
    </item>
  </channel>
</rss>

