<?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 oracle error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876191#M346206</link>
    <description>&lt;P&gt;If data is a datetime column, wy don't you do the bwtween based on datetime constants instead, thus ommitting datepart functions in the where clause.&lt;/P&gt;
&lt;P&gt;Then you could even ommit explict SQL pass through.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 11:56:22 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2023-05-17T11:56:22Z</dc:date>
    <item>
      <title>SAS oracle error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876143#M346189</link>
      <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I tried with below&amp;nbsp; code.&lt;FONT face="Menlo, Monaco, Consolas, Courier New, monospace" color="#c7254e"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; %LET START_ORA = %SYSFUNC(sum("&amp;amp;start"d,0),yymmdd10.) ;
      %LET END_ORA = %SYSFUNC(sum("&amp;amp;end"d,0),yymmdd10.) ;

       proc sql;
       connect to oracle(path="xxx" connection =shared);
       create table sample as 
       select * from connection to oracle 
       (select * from ori.auto as a
       where datepart(a.date) between %TSLIT(&amp;amp;START_ORA) and datepart(a.date) %TSLIT(&amp;amp;END_ORA)
       );
       quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error :ORACLE prepare error :ORA-00933: SQL command not properly ended. SQL statement : select * from ori.auto as a where datepart(a.date) between '2023-04-30' and datepart(a.date) '2023-04-30'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me resolve it?&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 01:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876143#M346189</guid>
      <dc:creator>suresh123</dc:creator>
      <dc:date>2023-05-17T01:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS oracle error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876146#M346190</link>
      <description>&lt;P&gt;You are using a SAS function DATEPART in SQL that needs to be Oracle-compatible. Try removing DATEPART and see how that runs.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 02:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876146#M346190</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-05-17T02:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS oracle error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876191#M346206</link>
      <description>&lt;P&gt;If data is a datetime column, wy don't you do the bwtween based on datetime constants instead, thus ommitting datepart functions in the where clause.&lt;/P&gt;
&lt;P&gt;Then you could even ommit explict SQL pass through.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 11:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-oracle-error/m-p/876191#M346206</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-05-17T11:56:22Z</dc:date>
    </item>
  </channel>
</rss>

