<?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 Using Macro variable in SAS EG v7.1: ERROR 79-322: Expecting a SELECT. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-Macro-variable-in-SAS-EG-v7-1-ERROR-79-322-Expecting-a/m-p/690134#M37256</link>
    <description>&lt;P&gt;Hi there, I'm attempting to use a macro variable that is erroring out and I'm not sure why. It works fine if I manually input the individual variables which tells me it's something with my macro, but I can't figure out what it is. They're text values so they have quotes, they're separated by commas and not periods, all of my standard checks are failing to identify the problem. It's built using a query builder rather than manual programming so user error can only come into play with setting up the macro. Any help you can give is MUCH APPRECIATED. I've googled as well as searched here and haven't been able to figure anything out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's where I set up the macro:&lt;/P&gt;&lt;P&gt;%let rptquarters = ('2019Q3','2019Q4','2020Q1','2020Q2');&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the log with the error:&lt;/P&gt;&lt;P&gt;26 PROC SQL;&lt;BR /&gt;27 CREATE TABLE EGTASK.WANT AS&lt;BR /&gt;28 SELECT t1.*&lt;BR /&gt;31 FROM EGTASK.HAVE t1&lt;BR /&gt;32 WHERE t1.FilledQuarter in (&amp;amp;rptquarters)&lt;BR /&gt;NOTE: Line generated by the macro variable "RPTQUARTERS".&lt;BR /&gt;32 ('2019Q3','2019Q4','2020Q1','2020Q2')&lt;BR /&gt;________ _&lt;BR /&gt;79 22&lt;BR /&gt;76&lt;BR /&gt;ERROR 79-322: Expecting a SELECT.&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?,&lt;BR /&gt;AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH,&lt;BR /&gt;LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;33 GROUP BY t1.CleanedClient;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;34 QUIT;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 18:27:28 GMT</pubDate>
    <dc:creator>AnissaG</dc:creator>
    <dc:date>2020-10-08T18:27:28Z</dc:date>
    <item>
      <title>Using Macro variable in SAS EG v7.1: ERROR 79-322: Expecting a SELECT.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-Macro-variable-in-SAS-EG-v7-1-ERROR-79-322-Expecting-a/m-p/690134#M37256</link>
      <description>&lt;P&gt;Hi there, I'm attempting to use a macro variable that is erroring out and I'm not sure why. It works fine if I manually input the individual variables which tells me it's something with my macro, but I can't figure out what it is. They're text values so they have quotes, they're separated by commas and not periods, all of my standard checks are failing to identify the problem. It's built using a query builder rather than manual programming so user error can only come into play with setting up the macro. Any help you can give is MUCH APPRECIATED. I've googled as well as searched here and haven't been able to figure anything out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's where I set up the macro:&lt;/P&gt;&lt;P&gt;%let rptquarters = ('2019Q3','2019Q4','2020Q1','2020Q2');&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the log with the error:&lt;/P&gt;&lt;P&gt;26 PROC SQL;&lt;BR /&gt;27 CREATE TABLE EGTASK.WANT AS&lt;BR /&gt;28 SELECT t1.*&lt;BR /&gt;31 FROM EGTASK.HAVE t1&lt;BR /&gt;32 WHERE t1.FilledQuarter in (&amp;amp;rptquarters)&lt;BR /&gt;NOTE: Line generated by the macro variable "RPTQUARTERS".&lt;BR /&gt;32 ('2019Q3','2019Q4','2020Q1','2020Q2')&lt;BR /&gt;________ _&lt;BR /&gt;79 22&lt;BR /&gt;76&lt;BR /&gt;ERROR 79-322: Expecting a SELECT.&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?,&lt;BR /&gt;AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH,&lt;BR /&gt;LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;33 GROUP BY t1.CleanedClient;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;34 QUIT;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 18:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-Macro-variable-in-SAS-EG-v7-1-ERROR-79-322-Expecting-a/m-p/690134#M37256</guid>
      <dc:creator>AnissaG</dc:creator>
      <dc:date>2020-10-08T18:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro variable in SAS EG v7.1: ERROR 79-322: Expecting a SELECT.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-Macro-variable-in-SAS-EG-v7-1-ERROR-79-322-Expecting-a/m-p/690135#M37257</link>
      <description>&lt;P&gt;The macro variable's content is inserted &lt;EM&gt;as is&lt;/EM&gt; in the place where you call it, &lt;EM&gt;including the brackets&lt;/EM&gt;. This causes SQL to expect a sub-select.&lt;/P&gt;
&lt;P&gt;Remove the brackets in the %LET statement.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 18:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-Macro-variable-in-SAS-EG-v7-1-ERROR-79-322-Expecting-a/m-p/690135#M37257</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-08T18:34:19Z</dc:date>
    </item>
  </channel>
</rss>

