<?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 error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435690#M108257</link>
    <description>&lt;P&gt;You need to post your full code and log, not snippets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The concept of a minimum reproducible example is what will get you help faster and half the time you'll solve&amp;nbsp; your own problem if you follow these steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/help/mcve" target="_blank"&gt;https://stackoverflow.com/help/mcve&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;In the following code, the macro&amp;nbsp;&lt;SPAN&gt;&amp;amp;table_list resolves to test_1,test_5,test_9 and these tables are available in the library&amp;nbsp;DEXVCOM as well. But when I run code, I'm receiving an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_1 does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_5 does not exist".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_9 &amp;nbsp;does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Macro has resolved correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set DEXVCOM.&amp;amp;table_list.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Appreciate if someone of you guide me to resolve the issue. I don't want to hard code the 'table list' value and I wish to get it dynamically.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 16:27:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-09T16:27:35Z</dc:date>
    <item>
      <title>Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435608#M108227</link>
      <description>&lt;P&gt;In the following code, the macro&amp;nbsp;&lt;SPAN&gt;&amp;amp;table_list resolves to test_1,test_5,test_9 and these tables are available in the library&amp;nbsp;DEXVCOM as well. But when I run code, I'm receiving an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_1 does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_5 does not exist".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_9 &amp;nbsp;does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Macro has resolved correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set DEXVCOM.&amp;amp;table_list.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Appreciate if someone of you guide me to resolve the issue. I don't want to hard code the 'table list' value and I wish to get it dynamically.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435608#M108227</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435609#M108228</link>
      <description>&lt;P&gt;I guess you are trying to append all the datasets , but while appending the dataset in a set statement you don't need to give a comma between 2 datasets name&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so change your macro value (it should resolve to test_1 (space) Test_2) and then run the code , it will work&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435609#M108228</guid>
      <dc:creator>soham_sas</dc:creator>
      <dc:date>2018-02-09T12:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435610#M108229</link>
      <description>&lt;P&gt;To be more clear, I received an error as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_1 does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_5 does not exist".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_9 &amp;nbsp;does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Macro has resolved correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435610#M108229</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435612#M108230</link>
      <description>&lt;P&gt;I am sure we have been over this time and time again.&amp;nbsp; Macro language is a textual find and replace tool, which is an additional component of &lt;U&gt;&lt;STRONG&gt;Base&lt;/STRONG&gt;&lt;/U&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;SAS&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Base SAS is the lanauge which you should learn be 100% familiar with before you attempt any macro, which is never ever needed.&amp;nbsp; Why do I keep saying this, it is because the question shows a distinct lack of understanding of Base SAS, lets take your given example of table_list being =&amp;nbsp;&lt;SPAN&gt;test_1,test_5,test_9.&amp;nbsp; We take that text and replace the macro variable with that text - this is all the macro processor is doing again:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  set&lt;/SPAN&gt; dexvcom&lt;SPAN class="token punctuation"&gt;.test_1,test_5,test_9&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Once we use indents and correct the upcase coding, then we see the code above.&amp;nbsp; Does this look like&amp;nbsp;the Base SAS coding which can be compiled and executed and do what you require.&amp;nbsp; The answer is no.&amp;nbsp; Now the next question to ask yourself is why you have things in the macro variable in the first place, from above we can see that macro does nothing, it is not executable or usable, it is purely a text find and replace system,&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;Base SAS&lt;/STRONG&gt;&lt;/U&gt; is the programming language, and so what we will do is use the programming language to perform the task:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435612#M108230</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-09T12:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435615#M108232</link>
      <description>&lt;P&gt;Thank you for the insights. Is there a way to loop the dataset name via macro? Appreciate if you could help me to tackle this scenario.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435615#M108232</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-09T12:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435620#M108235</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set %sysfunc(prxchange(s/([a-z0-9_]+)%str(,)*/dexvcom.${1}%str( )/,-1,%quote(&amp;amp;table_list.)));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435620#M108235</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-02-09T12:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435621#M108236</link>
      <description>&lt;P&gt;If you're going to program using macro language, it's a topic you will need to learn.&amp;nbsp; Here's some help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435621#M108236</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-09T12:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435673#M108251</link>
      <description>&lt;P&gt;The SAS options Mprint Symbolgen and Mlogic (if your macro has %if type statements to resolve logic) will show the code generated by your use of macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options mprint symbolgen;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;DEX&lt;/SPAN&gt;VCOM&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;table_list&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;And look at the log to see what code was actually generated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;options nomprint nosymbolgen;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;to reset the options.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435673#M108251</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-09T15:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435690#M108257</link>
      <description>&lt;P&gt;You need to post your full code and log, not snippets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The concept of a minimum reproducible example is what will get you help faster and half the time you'll solve&amp;nbsp; your own problem if you follow these steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/help/mcve" target="_blank"&gt;https://stackoverflow.com/help/mcve&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;In the following code, the macro&amp;nbsp;&lt;SPAN&gt;&amp;amp;table_list resolves to test_1,test_5,test_9 and these tables are available in the library&amp;nbsp;DEXVCOM as well. But when I run code, I'm receiving an error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_1 does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_5 does not exist".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"ERROR: File WORK.test_9 &amp;nbsp;does not exist"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Macro has resolved correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set DEXVCOM.&amp;amp;table_list.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Appreciate if someone of you guide me to resolve the issue. I don't want to hard code the 'table list' value and I wish to get it dynamically.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-error/m-p/435690#M108257</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T16:27:35Z</dc:date>
    </item>
  </channel>
</rss>

