<?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 CLI Error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90811#M25932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I, too, am not familiar with Oracle SQL, but:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I doubt if the following is valid.&amp;nbsp; Shouldn't it be starting with "case"?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;ase when ISFILTERED = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: purple;"&gt;'TRUE'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt; then &lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: teal; background-color: white;"&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 May 2013 00:59:50 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2013-05-31T00:59:50Z</dc:date>
    <item>
      <title>PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90808#M25929</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;I have the following code which runs fine without the where statement. But as soon as I include it, I get an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;Basedate&amp;nbsp; = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;(Today(),date9.); &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*todays&lt;BR /&gt;date*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;PrevMonthStartdate = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;(intnx(Month,&lt;BR /&gt;"&amp;amp;Basedate"d,-1,b), date9.); &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*start date of the&lt;BR /&gt;previous month*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;PrevMonthEnddate = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;(intnx(Month,&lt;BR /&gt;"&amp;amp;Basedate"d,-1,e), date9.); &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*end date of the&lt;BR /&gt;previous month*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;&amp;amp;prevmonthstartdate;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;XXX.TL_X;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;date2 &lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;date2=trxn_date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;connect&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; odbc (user=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;"&amp;amp;mida_username."&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;password=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;"&amp;amp;mida_password."&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;DSN=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;"&amp;amp;mida_source."&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;execute&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;Create table&lt;BR /&gt;LBG_REPORTING_1 as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;select&amp;nbsp; TRXN_DATE as TRANMONTH,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;case&amp;nbsp;&amp;nbsp;&amp;nbsp; when CHANNELTYPE = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'@SES'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;then &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Digital'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;when CHANNELTYPE in (&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'@CALLCENTER'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'@IVR'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;BR /&gt;then &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Telephony'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;when CHANNELTYPE is null and TRANSACTIONTYPE in (&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'OTP'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'ENROLLMENT'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;BR /&gt;then &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Digi NM'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;else &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'Other'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; end as CHANNEL,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;TRANSACTIONTYPE as MODEL, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;case when (TRXTYPECD = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'InternalTransfer'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; or TRXTYPECD&lt;BR /&gt;like &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'%Me2Me%'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;) then &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;else &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; end as ME2ME,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;ase when ISFILTERED = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New'; font-size: 10pt;"&gt;'TRUE'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; then &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;else &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; end as ISFILTERED, &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;TRXN_ID,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;CUSTID,&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;AMOUNT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;from&amp;nbsp;&amp;nbsp; &lt;BR /&gt;(select * from XXX.TL_X &lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*where&lt;BR /&gt;distinct(trunc(TRXN_DATE,'MONTH')) BETWEEN TRUNC(ADD_MONTHS(SYSDATE, -1),'Month')&lt;BR /&gt;AND TRUNC(LAST_DAY(ADD_MONTHS(SYSDATE,-1))+1)*/ &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;where datepart(TRXN_DATE) = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;'&amp;amp;prevmonthstartdate'd&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;BR /&gt;)a ) &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; odbc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;disconnect&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; odbc;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;ERROR:&lt;BR /&gt;CLI execute error: [Oracle][ODBC][Ora]ORA-00907: missing right parenthesis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above is the error I get. I'm guessing I'm missing something obvious?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 20:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90808#M25929</guid>
      <dc:creator>thegraduate</dc:creator>
      <dc:date>2013-05-30T20:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90809#M25930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 22:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90809#M25930</guid>
      <dc:creator>thegraduate</dc:creator>
      <dc:date>2013-05-30T22:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90810#M25931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't forget that everything in the Execute clause must be compatible with Oracle version of SQL. I don't know Oracle SQL but your WHERE clause looks very much like SAS SQL.&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 00:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90810#M25931</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-31T00:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90811#M25932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I, too, am not familiar with Oracle SQL, but:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I doubt if the following is valid.&amp;nbsp; Shouldn't it be starting with "case"?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;ase when ISFILTERED = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: purple;"&gt;'TRUE'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt; then &lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Courier New'; color: teal; background-color: white;"&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 00:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90811#M25932</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-05-31T00:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90812#M25933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art, those lost characters are only the consequence of a copy and paste bug that shows up when pasting directly from SAS enhanced editor to MS Internet Explorer. I suspect the problem is either with the datepart function or the date litteral syntax in the WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 01:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90812#M25933</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-31T01:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90813#M25934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i've moved the datepart to the first datastep which resolves one potential issue, with regards to the date macro (the date must match to the first date of the previous month), does anyone know how to do this in oracle/sql?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 07:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90813#M25934</guid>
      <dc:creator>thegraduate</dc:creator>
      <dc:date>2013-05-31T07:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90814#M25935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to get help on Oracle SQL syntax, you are in the wrong forum.&lt;/P&gt;&lt;P&gt;Why don't you try to use implicit SQL pass-thru, many SAS functions will be translated by the SAS/ACCESS engine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 08:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90814#M25935</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-05-31T08:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90815#M25936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not found a solution (other than moving the date selection criteria from ORACLE sql to SAS sql).&amp;nbsp; I did find out that the problem is in Oracle.&amp;nbsp; The same where code, that works for one of my source ORACLE databases, fails on the other of my source ORACLE databases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/***&amp;nbsp; From GOOGLE:&lt;/P&gt;&lt;P&gt;This is an ORACLE "red herring" error that is common on some Oracle databases.&amp;nbsp; A single quote or pair of single quotes needs to be two single quotes or two pairs of single quotes.&lt;/P&gt;&lt;P&gt;ERROR: Prepare error: ICommandPrepare::Prepare failed. : ORA-00907: missing right parenthesis&lt;/P&gt;&lt;P&gt;SQL statement: SELECT j.* FROM NCMR.VCI_NIC_NC_MAIN j where j.etq_created_date &amp;gt;= (to_date(01AUG2013:00:00:00,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'DDMONYYYY:HH:MI:SS')).&lt;/P&gt;&lt;P&gt;***/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 14:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90815#M25936</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2014-08-15T14:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90816#M25937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this. Oracle, from memory, can cope with unambiguous date strings with hyphens and enclosed in single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 8pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt; PrevMonthStartdate = &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 8pt;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt;(%')&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 8pt;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt;(intnx(Month,"19AUG2014"d,-1,b),yymmdd10.)&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 8pt;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt;(%');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 8pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt; &amp;amp;PrevMonthStartdate;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;SPAN style="font-family: Consolas;"&gt;SQL: &lt;/SPAN&gt;where TRXN_DATE = &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;&amp;amp;prevmonthstartdate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 20:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90816#M25937</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-08-18T20:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90817#M25938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use explicit pass thruogh in the full approach&amp;nbsp; to some RDBMS do not use anything that is common to SAS language. The RDBMS does not understand SAS language or any of those references. I See:&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;where datepart(TRXN_DATE) = &lt;/SPAN&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New'; font-size: 10pt;"&gt;'&amp;amp;prevmonthstartdate'd.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you wan the find the cause break the sql up in smaller understandable pieces. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background: white; color: teal; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 20:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90817#M25938</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-18T20:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90818#M25939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried SQL_FUNCTIONS=ALL option?&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002155060.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002155060.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90818#M25939</guid>
      <dc:creator>dataMart87</dc:creator>
      <dc:date>2014-08-18T21:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90819#M25940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rommel that is a nice link,&amp;nbsp; but did you notice: "Due to incompatibility in date and time functions between ODBC and SAS, ODBC might not process them correctly".&amp;nbsp; The date, time and datetime conventions in several systems are not the same. A string common to sas as '... 'd&amp;nbsp; has not a meaning in Oracle.&amp;nbsp;&amp;nbsp; An other one often causing problems is the "reserved words" list. These are also not equal, sometimes causing surprising results.&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;This list of SQL-fucntions is used with implicit pass thru in optimizing the SQL language translation form SAS Ansi to a native SQL dialect.&lt;BR /&gt;With explicit pass thru (execute statement) you are the one coding in a native SQL dialect. SAS has his hands off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For debugging features.:&lt;/P&gt;&lt;P&gt;- sastrace&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#n0732u1mr57ycrn1urf24gzo38sc.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/67473/HTML/default/viewer.htm#n0732u1mr57ycrn1urf24gzo38sc.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Fifth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- explain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://docs.oracle.com/cd/B10500_01/server.920/a96533/ex_plan.htm" title="http://docs.oracle.com/cd/B10500_01/server.920/a96533/ex_plan.htm"&gt;Using EXPLAIN PLAN&lt;/A&gt;&amp;nbsp; If you want to know what happens when the sql is correct.&lt;BR /&gt;Do you have Oracle sql developer (free tool) you can develop and verify the Oracle Sql. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 05:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90819#M25940</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-19T05:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CLI Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90820#M25941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Jaap.&amp;nbsp; I don't speak Oracle SQL very well, and I don't have the developer tool.&amp;nbsp; Looks interesting though that I just might research it a bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 16:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-CLI-Error/m-p/90820#M25941</guid>
      <dc:creator>dataMart87</dc:creator>
      <dc:date>2014-08-19T16:18:29Z</dc:date>
    </item>
  </channel>
</rss>

