<?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: MAX(OF variable list) syntax within PROC SQL? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197622#M49396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the issue is a more generic restriction on not allowing any variable lists in Proc sql.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 14:54:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-04-16T14:54:25Z</dc:date>
    <item>
      <title>MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197621#M49395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a lot of SAS language functionality within my PROC SQL queries.&amp;nbsp; I was stunned recently when I got an error message from SAS 9.4:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, ',', -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, &lt;/P&gt;&lt;P&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; BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the following query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt; SELECT MAX(MAX(OF v1 - v4))&lt;/P&gt;&lt;P&gt; INTO :max_v&lt;/P&gt;&lt;P&gt; FROM ds1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This equivalent query works as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt; SELECT MAX(MAX(v1, v2, v3, v4))&lt;/P&gt;&lt;P&gt; INTO :max_v&lt;/P&gt;&lt;P&gt; FROM ds1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the "OF" syntax have worked?&amp;nbsp; If not, is this documented somewhere?&amp;nbsp; If so, any idea what I did wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 14:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197621#M49395</guid>
      <dc:creator>TMKAIG1</dc:creator>
      <dc:date>2015-04-16T14:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197622#M49396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the issue is a more generic restriction on not allowing any variable lists in Proc sql.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 14:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197622#M49396</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-16T14:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197623#M49397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed, I believe SAS uses standard ANSI SQL, which has a function MAX which requires a list of parameters separated by commas.&amp;nbsp; If SAS changed this to use their own variable list setup, it would no longer be ANSI compliant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 15:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197623#M49397</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-16T15:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197624#M49398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use variable lists in SQL.&lt;/P&gt;&lt;P&gt;You also cannot use : modifier in truncated string comparisons.&amp;nbsp; Instead use the mnemonics with T on the end.&amp;nbsp; So use EQT instead of =: .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 16:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197624#M49398</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-16T16:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197625#M49399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; Not sure this is true. The standard describes what is legal syntax but not what should be done with illegal queries. For example, I don't think the &lt;STRONG&gt;SELECT myVar INTO :myMacro&lt;/STRONG&gt; syntax makes SAS/SQL non compliant. IMHO, variable lists are not implemented in SAS/SQL for other reasons. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 21:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197625#M49399</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-04-16T21:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: MAX(OF variable list) syntax within PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197626#M49400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi PGStats,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure, you maybe right.&amp;nbsp; My impression was that anything defined in ANSI SQL, of which a function called MAX() is, should be standard.&amp;nbsp; The select into part is SAS specific, i.e. it will only run in SAS SQL, however it is not altering the base functionality of ANSI SQL.&amp;nbsp; If however you mess with the functions which are already implemented, then that would be changing the base.&amp;nbsp; I have been wrong before however :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 07:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MAX-OF-variable-list-syntax-within-PROC-SQL/m-p/197626#M49400</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-17T07:49:15Z</dc:date>
    </item>
  </channel>
</rss>

