<?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: Incorrect Syntax near the keyword 'WHERE' in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262620#M7213</link>
    <description>Ok so it's Join transformations with explicit pass thru. Looks like it's generated code, right? &lt;BR /&gt;Even so, it's possible to generate non syntactically correct SQL. Try the pass thru part in SQL Server Management Studio. &lt;BR /&gt;&lt;BR /&gt;Why are you using explicit pass thru?&lt;BR /&gt;Looks like your query could easily be restructured from the in line view join to  group by-having. By use that simple syntax chances are pretty high that it will be passed thru implicitly and that would hopefully solve your syntax problem.</description>
    <pubDate>Sat, 09 Apr 2016 00:02:11 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-04-09T00:02:11Z</dc:date>
    <item>
      <title>Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262607#M7208</link>
      <description>&lt;P&gt;I have a job that is erroring out at the very end, and getting an error at the keyword "WHERE". &amp;nbsp;It's using a Subquery to extract the most recent row processing date, and using that date as a filter for bringing in the source data. &amp;nbsp;Below is the code that is erroring out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;MAX(V_DMI_CIF_Daily_sub.DWDATE_Int ) as Max_Date&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily_sub&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;where&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;V_DMI_CIF_Daily.DWDATE_Int = Max_Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;%rcSet(&amp;amp;sqlrc); &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;disconnect from ODBC; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262607#M7208</guid>
      <dc:creator>Daylon_Hunt</dc:creator>
      <dc:date>2016-04-08T22:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262608#M7209</link>
      <description>&lt;P&gt;Would you like to share the log with the complete code and error massages? That wouldgreatly help others Help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheets Jan.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262608#M7209</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-04-08T22:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262610#M7210</link>
      <description>&lt;P&gt;In your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily, 
(
select
MAX(V_DMI_CIF_Daily_sub.DWDATE_Int ) as Max_Date
from
bnkDbDataGov.V_DMI_CIF_Daily as V_DMI_CIF_Daily_sub
)
where
V_DMI_CIF_Daily.DWDATE_Int = Max_Date

);


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From what you post the last ) does not have a matching ( .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log is always a good idea as it is often pretty good about showing where issues are.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:19:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262610#M7210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-08T22:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262612#M7211</link>
      <description>&lt;P&gt;The "disconnect from ODBC" tells me that the problem i s&amp;nbsp;probably related to some syntax within your (guessing here) ...from&amp;nbsp;connection to-block. So technically, it may not be a SAS issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262612#M7211</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-08T22:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262614#M7212</link>
      <description>&lt;P&gt;Attached is the log, and the error is occurring at row 1320&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 23:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262614#M7212</guid>
      <dc:creator>Daylon_Hunt</dc:creator>
      <dc:date>2016-04-08T23:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262620#M7213</link>
      <description>Ok so it's Join transformations with explicit pass thru. Looks like it's generated code, right? &lt;BR /&gt;Even so, it's possible to generate non syntactically correct SQL. Try the pass thru part in SQL Server Management Studio. &lt;BR /&gt;&lt;BR /&gt;Why are you using explicit pass thru?&lt;BR /&gt;Looks like your query could easily be restructured from the in line view join to  group by-having. By use that simple syntax chances are pretty high that it will be passed thru implicitly and that would hopefully solve your syntax problem.</description>
      <pubDate>Sat, 09 Apr 2016 00:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262620#M7213</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-09T00:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262664#M7214</link>
      <description>Edit: not GROUP BY - just HAVING. &lt;span class="lia-unicode-emoji" title=":flushed_face:"&gt;😳&lt;/span&gt;</description>
      <pubDate>Sat, 09 Apr 2016 11:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/262664#M7214</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-09T11:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Syntax near the keyword 'WHERE'</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/263020#M7239</link>
      <description>Using the "Having" instead of "Where" appears to have done the trick. Although, it wouldn't work without using the "Group By" too. I still feel like I'm not going about this particular job in the most efficient way, I'm learning a lot as I go.</description>
      <pubDate>Mon, 11 Apr 2016 20:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Incorrect-Syntax-near-the-keyword-WHERE/m-p/263020#M7239</guid>
      <dc:creator>Daylon_Hunt</dc:creator>
      <dc:date>2016-04-11T20:21:12Z</dc:date>
    </item>
  </channel>
</rss>

