<?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: Macro errors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33343#M6499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art297,&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. I tried your suggestion but the errors do not change at all. I get the exact same errors in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;saspert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2011 14:33:15 GMT</pubDate>
    <dc:creator>saspert</dc:creator>
    <dc:date>2011-07-19T14:33:15Z</dc:date>
    <item>
      <title>Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33340#M6496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to troubleshoot a fairly simple macro logic. The code is here -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro loop(values);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Count the number of values in the string */&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let count=%sysfunc(countw(&amp;amp;values)); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Loop through the total number of values */&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;&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;&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;&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i = 1 %to &amp;amp;count;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let value=%qscan(&amp;amp;values,&amp;amp;i);&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;&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;value;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CREATE TABLE DEMOGRAPHICS_BASE_&amp;amp;VALUE AS &lt;/P&gt;&lt;P&gt;(SELECT (COUNT ( DEMOGRAPHICS_BASE.DEMO_PARTICIPATING_USERS)) AS DEMO_PRTCPTNG_USERS&lt;/P&gt;&lt;P&gt;,DEMOGRAPHICS_BASE.DEMO_&amp;amp;VALUE._GROUPING &lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM WORK.DEMOGRAPHICS_BASE AS DEMOGRAPHICS_BASE &lt;/P&gt;&lt;P&gt;INNER JOIN WORK.DEMOGRAPHICS_BASE_100 AS DEMOGRAPHICS_BASE_100 ON (DEMOGRAPHICS_BASE.DEMO_PRCHSR_CODE = DEMOGRAPHICS_BASE_100.DEMO_PRCHSR_CODE)&lt;/P&gt;&lt;P&gt;&amp;nbsp; GROUP BY DEMOGRAPHICS_BASE.DEMO_&amp;amp;VALUE._GROUPING&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%mend;&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;&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;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%loop(%str(AGE ETHN GDR))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the log -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MPRINT(LOOP): PROC SQL;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable VALUE resolves to AGE&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the invoked macro "LOOP".&lt;/P&gt;&lt;P&gt;56 PROC SQL; CREATE&lt;/P&gt;&lt;P&gt;56 ! TABLE DEMOGRAPHICS_BASE_&amp;amp;VALUE AS (SELECT (COUNT ( DEMOGRAPHICS_BASE.DEMO_PARTICIPATING_USERS)) AS DEMO_PRTCPTNG_USERS&lt;/P&gt;&lt;P&gt;__&lt;/P&gt;&lt;P&gt;202&lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "VALUE".&lt;/P&gt;&lt;P&gt;56 DEMOGRAPHICS_BASE_AGE&lt;/P&gt;&lt;P&gt;___&lt;/P&gt;&lt;P&gt;78&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable VALUE resolves to AGE&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "VALUE".&lt;/P&gt;&lt;P&gt;56 DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING&lt;/P&gt;&lt;P&gt;___ _________&lt;/P&gt;&lt;P&gt;22 202&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable VALUE resolves to AGE&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;ERROR 78-322: Expecting a '.'.&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;/P&gt;&lt;P&gt;AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH, &lt;/P&gt;&lt;P&gt;LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=. &lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "VALUE".&lt;/P&gt;&lt;P&gt;56 DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING&lt;/P&gt;&lt;P&gt;3 The SAS System 10:10 Monday, July 18, 2011&lt;/P&gt;&lt;P&gt;___ _________&lt;/P&gt;&lt;P&gt;22 202&lt;/P&gt;&lt;P&gt;MPRINT(LOOP): CREATE TABLE DEMOGRAPHICS_BASE_AGE AS (SELECT (COUNT ( DEMOGRAPHICS_BASE.DEMO_PARTICIPATING_USERS)) AS &lt;/P&gt;&lt;P&gt;DEMO_PRTCPTNG_USERS ,DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING FROM AS DEMOGRAPHICS_BASE INNER JOIN WORK.DEMOGRAPHICS_BASE_100 AS &lt;/P&gt;&lt;P&gt;DEMOGRAPHICS_BASE_100 ON (DEMOGRAPHICS_BASE.DEMO_PRCHSR_CODE = DEMOGRAPHICS_BASE_100.DEMO_PRCHSR_CODE) GROUP BY &lt;/P&gt;&lt;P&gt;DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING );&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, BETWEEN, &lt;/P&gt;&lt;P&gt;CONTAINS, EQ, EQT, EXCEPT, GE, GET, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, &lt;/P&gt;&lt;P&gt;OR, OUTER, UNION, ^, ^=, |, ||, ~, ~=. &lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;&lt;P&gt;MPRINT(LOOP): QUIT;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;user cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;system cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;Memory 48k&lt;/P&gt;&lt;P&gt;Page Faults 1&lt;/P&gt;&lt;P&gt;Page Reclaims 35&lt;/P&gt;&lt;P&gt;Page Swaps 0&lt;/P&gt;&lt;P&gt;Voluntary Context Switches 0&lt;/P&gt;&lt;P&gt;Involuntary Context Switches 1&lt;/P&gt;&lt;P&gt;Block Input Operations 0&lt;/P&gt;&lt;P&gt;Block Output Operations 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable VALUES resolves to AGE ETHN GDR&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable I resolves to 2&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable VALUE resolves to ETHN&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;ETHN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that both DEMOGRAPHICS_BASE_100 and DEMOGRAPHICS_BASE are working fine and are created prior to this macro. I am trying hard for several hours to pinpoint the bug but not able to do so. Appreciate any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;saspert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2011 21:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33340#M6496</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-18T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33341#M6497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's start with the first one.&amp;nbsp; Put quotes around the macro variable in the early line where you are establishing the count macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the line to&lt;/P&gt;&lt;P&gt;%let count=%sysfunc(countw("&amp;amp;values"));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2011 21:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33341#M6497</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-18T21:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33342#M6498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks more like an SQL issue than a macro issue.&lt;/P&gt;&lt;P&gt;Try taking the generated command from the MPRINT line and running it standalone.&lt;/P&gt;&lt;P&gt;I get the following error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: File WORK.AS.DATA does not exist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 00:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33342#M6498</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-07-19T00:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33343#M6499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art297,&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. I tried your suggestion but the errors do not change at all. I get the exact same errors in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;saspert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33343#M6499</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-19T14:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33344#M6500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Tom,&lt;/P&gt;&lt;P&gt;If I understand you correctly, you want to check the SQL query and see if it runs properly (outside of the macro). Is that correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 14 PROC SQL;&lt;/P&gt;&lt;P&gt;15 CREATE TABLE DEMOGRAPHICS_BASE_AGE AS&lt;/P&gt;&lt;P&gt;16 (SELECT (COUNT ( DEMOGRAPHICS_BASE.DEMO_PARTICIPATING_USERS)) AS DEMO_PRTCPTNG_USERS&lt;/P&gt;&lt;P&gt;17 ,DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING&lt;/P&gt;&lt;P&gt;18 FROM WORK.DEMOGRAPHICS_BASE AS DEMOGRAPHICS_BASE&lt;/P&gt;&lt;P&gt;19 INNER JOIN WORK.DEMOGRAPHICS_BASE_100 AS DEMOGRAPHICS_BASE_100 ON (DEMOGRAPHICS_BASE.DEMO_PRCHSR_CODE =&lt;/P&gt;&lt;P&gt;19 ! DEMOGRAPHICS_BASE_100.DEMO_PRCHSR_CODE)&lt;/P&gt;&lt;P&gt;20 GROUP BY DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING&lt;/P&gt;&lt;P&gt;21 );&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.DEMOGRAPHICS_BASE_AGE created, with 4 rows and 2 columns.&lt;/P&gt;&lt;P&gt;22 QUIT;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;user cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;system cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;Memory 1560k&lt;/P&gt;&lt;P&gt;Page Faults 0&lt;/P&gt;&lt;P&gt;Page Reclaims 330&lt;/P&gt;&lt;P&gt;Page Swaps 0&lt;/P&gt;&lt;P&gt;Voluntary Context Switches 4&lt;/P&gt;&lt;P&gt;Involuntary Context Switches 1&lt;/P&gt;&lt;P&gt;Block Input Operations 0&lt;/P&gt;&lt;P&gt;Block Output Operations 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;saspert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33344#M6500</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-19T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33345#M6501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Making the change I suggested SHOULD have removed at least one of the errors.&amp;nbsp; Is there a reason you use %qscan rather than %scan?.&amp;nbsp; Your log indicates something about certain characters being omitted that may have been masked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33345#M6501</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-19T14:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33346#M6502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;saspert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is your mprint line from your original code (above):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MPRINT(LOOP): CREATE TABLE DEMOGRAPHICS_BASE_AGE AS (SELECT (COUNT ( DEMOGRAPHICS_BASE.DEMO_PARTICIPATING_USERS)) AS &lt;/P&gt;&lt;P&gt;DEMO_PRTCPTNG_USERS ,DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;FROM AS &lt;/STRONG&gt;&lt;/SPAN&gt;DEMOGRAPHICS_BASE INNER JOIN WORK.DEMOGRAPHICS_BASE_100 AS &lt;/P&gt;&lt;P&gt;DEMOGRAPHICS_BASE_100 ON (DEMOGRAPHICS_BASE.DEMO_PRCHSR_CODE = DEMOGRAPHICS_BASE_100.DEMO_PRCHSR_CODE) GROUP BY &lt;/P&gt;&lt;P&gt;DEMOGRAPHICS_BASE.DEMO_AGE_GROUPING );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the "FROM AS" (emphasis added).&amp;nbsp; There is something wrong with your original SQL code that is causing&lt;/P&gt;&lt;P&gt; WORK.DEMOGRAPHICS_BASE to be dropped.&amp;nbsp; I can't see why, but that's were the problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33346#M6502</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-07-19T14:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33347#M6503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Art,&lt;/P&gt;&lt;P&gt;When I try %scan instead of %qscan, all the errors were resolved. I guess the original code was trying to parse through AGE,GDR,ETHN and had a qscan for that reason. But, when I adapted that code in my EG project, I took out the commas but did not change the %qscan to %scan. Does that sound like the root cause? Appreciate your tip very much.&lt;/P&gt;&lt;P&gt;But to answer your question, your original suggestion of putting the quotes did not help.&lt;/P&gt;&lt;P&gt;Hi Doc,&lt;/P&gt;&lt;P&gt;I looked at the code again. What you pointed was a definitely a bug. But when I am reviewing the code now , it looks as if that is taken care of.&amp;nbsp; Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom,Art, Doc - appreciate all the help guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;saspert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2011 15:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-errors/m-p/33347#M6503</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-19T15:23:14Z</dc:date>
    </item>
  </channel>
</rss>

