<?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: Syntax error in code - assistance needed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552385#M153551</link>
    <description>&lt;P&gt;On top of what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;I guess that "they use TOAD" means that the SQL you're trying to execute is in a database flavor. To execute such code unchanged you need to use explicit pass-through in SAS.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2019 03:29:53 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-04-19T03:29:53Z</dc:date>
    <item>
      <title>Syntax error in code - assistance needed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552247#M153503</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SELECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DISTINCT&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FC_ATTORNEY_ID, FC_ATTORNEY_NM, REC_CHNG_DT&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; T_FORECLOSURE T_FORECLOSURE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;WHERE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (FC_ATTORNEY_ID, REC_CHNG_DT) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IN&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;SELECT&lt;/P&gt;
&lt;P&gt;FC_ATTORNEY_ID&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;, MAX (REC_CHNG_DT) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; LST_DT&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; T_FORECLOSURE T_FORECLOSURE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;WHERE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REC_CHNG_CD &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;In&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'A'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'C'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FC_ATTORNEY_ID&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REC_CHNG_CD &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;In&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'A'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'C'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I received the above code from another dept.&amp;nbsp; They use TOAD.&amp;nbsp; When I run this in sas I get the following errors;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;22 proc sql;&lt;/P&gt;
&lt;P&gt;23 create table test as&lt;/P&gt;
&lt;P&gt;24 SELECT DISTINCT&lt;/P&gt;
&lt;P&gt;25 FC_ATTORNEY_ID, FC_ATTORNEY_NM, REC_CHNG_DT&lt;/P&gt;
&lt;P&gt;26 FROM RDX.T_FORECLOSURE T_FORECLOSURE&lt;/P&gt;
&lt;P&gt;27 WHERE (FC_ATTORNEY_ID, REC_CHNG_DT) IN&lt;/P&gt;
&lt;P&gt;_&lt;/P&gt;
&lt;P&gt;79&lt;/P&gt;
&lt;P&gt;ERROR 79-322: Expecting a (.&lt;/P&gt;
&lt;P&gt;28 (&lt;/P&gt;
&lt;P&gt;29 SELECT&lt;/P&gt;
&lt;P&gt;30 FC_ATTORNEY_ID&lt;/P&gt;
&lt;P&gt;31 , MAX (REC_CHNG_DT) AS LST_DT&lt;/P&gt;
&lt;P&gt;32 FROM RDX.T_FORECLOSURE T_FORECLOSURE&lt;/P&gt;
&lt;P&gt;33 WHERE REC_CHNG_CD In ('A','C')&lt;/P&gt;
&lt;P&gt;34 GROUP BY FC_ATTORNEY_ID&lt;/P&gt;
&lt;P&gt;35 ) AND REC_CHNG_CD In ('A','C')&lt;/P&gt;
&lt;P&gt;36 ;&lt;/P&gt;
&lt;P&gt;_&lt;/P&gt;
&lt;P&gt;79&lt;/P&gt;
&lt;P&gt;ERROR 79-322: Expecting a ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552247#M153503</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-04-18T18:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code - assistance needed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552255#M153505</link>
      <description>&lt;P&gt;Ask the "other department" what they expected this syntactically invalid code to do. The where condition makes no sense.&lt;/P&gt;
&lt;P&gt;What should this&lt;/P&gt;
&lt;PRE&gt;(FC_ATTORNEY_ID, REC_CHNG_DT)&lt;/PRE&gt;
&lt;P&gt;be?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552255#M153505</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-18T18:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code - assistance needed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552288#M153514</link>
      <description>&lt;P&gt;thanks.&amp;nbsp; I only posted this to see if anyone else had used this combination.&amp;nbsp; I will reach out to the dept that provided this in the first place.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552288#M153514</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-04-18T19:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code - assistance needed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552385#M153551</link>
      <description>&lt;P&gt;On top of what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;I guess that "they use TOAD" means that the SQL you're trying to execute is in a database flavor. To execute such code unchanged you need to use explicit pass-through in SAS.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 03:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552385#M153551</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-04-19T03:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code - assistance needed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552387#M153553</link>
      <description>&lt;P&gt;You cannot use the IN operation to compare multiple variables.&amp;nbsp; Just single values.&lt;/P&gt;
&lt;P&gt;But it looks like you are just trying to find the MAX date.&lt;/P&gt;
&lt;P&gt;SAS will allow this syntax to find the maximum based on just the ID variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table test as
SELECT DISTINCT
  FC_ATTORNEY_ID
, FC_ATTORNEY_NM
, max(REC_CHNG_DT) as REX_CHNG_DT
FROM T_FORECLOSURE T_FORECLOSURE
WHERE REC_CHNG_CD in ('A','C')
GROUP BY FC_ATTORNEY_ID
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I suspect that Attorney's only have one name so even what ever database your Toad user is connecting to will allow this syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table test as
SELECT DISTINCT
  FC_ATTORNEY_ID
, FC_ATTORNEY_NM
, max(REC_CHNG_DT) as REX_CHNG_DT
FROM T_FORECLOSURE T_FORECLOSURE
WHERE REC_CHNG_CD in ('A','C')
GROUP BY FC_ATTORNEY_ID, FC_ATTORNEY_NM
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Apr 2019 04:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code-assistance-needed/m-p/552387#M153553</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-19T04:15:38Z</dc:date>
    </item>
  </channel>
</rss>

