<?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 Deriving Macro variable name from other macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153755#M30149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a macro for create table in teradata and i woudl like to call that macro for each table. So i have wrote the below mentioned code but i am getting a typical warning and the table is not created as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;%let ini= VK;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let &lt;/SPAN&gt;fcode=ab123;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let &lt;/SPAN&gt;work=wt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; brand2 = Very;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;%let SEASON2=AW14;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New'; font-size: 11pt;"&gt;%macro f&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;ilecheck (DB=, Tablename=, sql_code=, indx=);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;proc sql;&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;connect to teradata (user=&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;user.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt; password=&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;password. &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;mode=teradata);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;OPTIONS COMPRESS=YES;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;EXECUTE&amp;nbsp;&amp;nbsp;&amp;nbsp; (ct &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;tablename. &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;sql_code.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt; &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;indx.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;) by teradata;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;%&lt;EM&gt;filecheck_create&lt;/EM&gt;&lt;BR /&gt;(DB=*****, Tablename=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 11pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;(%&lt;EM&gt;trim&lt;/EM&gt;(&amp;amp;ini._&amp;amp;Fcode._brow_&amp;amp;brand2._&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;season2.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;)_&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;work.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;),&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;sql_code=(aba, abc), indx= primary index (abc)) by teradata;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The quoted string currently being processed has become more than 262 characters long.&amp;nbsp; You might have unbalanced quotation marks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above code resolving the table name but it is not creating the table and generating the warning. Can some one help what is the solution for the same to define table in the same pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 11:55:35 GMT</pubDate>
    <dc:creator>venkata_peddisetty</dc:creator>
    <dc:date>2014-09-22T11:55:35Z</dc:date>
    <item>
      <title>Deriving Macro variable name from other macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153755#M30149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a macro for create table in teradata and i woudl like to call that macro for each table. So i have wrote the below mentioned code but i am getting a typical warning and the table is not created as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;%let ini= VK;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let &lt;/SPAN&gt;fcode=ab123;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let &lt;/SPAN&gt;work=wt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; brand2 = Very;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;%let SEASON2=AW14;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New'; font-size: 11pt;"&gt;%macro f&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;ilecheck (DB=, Tablename=, sql_code=, indx=);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;proc sql;&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;connect to teradata (user=&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;user.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt; password=&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;password. &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;mode=teradata);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;OPTIONS COMPRESS=YES;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;EXECUTE&amp;nbsp;&amp;nbsp;&amp;nbsp; (ct &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;tablename. &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;sql_code.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt; &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;indx.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;) by teradata;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;%&lt;EM&gt;filecheck_create&lt;/EM&gt;&lt;BR /&gt;(DB=*****, Tablename=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 11pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;(%&lt;EM&gt;trim&lt;/EM&gt;(&amp;amp;ini._&amp;amp;Fcode._brow_&amp;amp;brand2._&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;season2.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;)_&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;work.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;),&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;sql_code=(aba, abc), indx= primary index (abc)) by teradata;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The quoted string currently being processed has become more than 262 characters long.&amp;nbsp; You might have unbalanced quotation marks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above code resolving the table name but it is not creating the table and generating the warning. Can some one help what is the solution for the same to define table in the same pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 11:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153755#M30149</guid>
      <dc:creator>venkata_peddisetty</dc:creator>
      <dc:date>2014-09-22T11:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Deriving Macro variable name from other macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153756#M30150</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 suspect that the this is the problem:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 11pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;(%&lt;EM&gt;trim&lt;/EM&gt;(&amp;amp;ini._&amp;amp;Fcode._brow_&amp;amp;brand2._&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;season2.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;)_&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; font-size: 11pt;"&gt;work.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;Not sure why you need the %put to start with.&amp;nbsp; Also the %trim is great, however your not trimming the individual elements:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;Use options mlogic mprint symblogen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;You will see that &amp;amp;ini for instance will resolve as the text, plus some spaces (up to minimum length 8 I believe)so your output may look like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;ini=xyxy, bran2=tytyty&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;xyxy&amp;nbsp;&amp;nbsp;&amp;nbsp; _brow_tytyty&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;Try to trim each bit:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 11pt;"&gt;%trim(&amp;amp;ini)_%trim(&amp;amp;fcode)_brow_%trim(&amp;amp;brand2)...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;AS a final thought, you might want to consider using catx function e.g:&lt;/P&gt;&lt;P&gt;%sysfunc(catx("_",&amp;amp;ini.,&amp;amp;fcode.,"_brow_",&amp;amp;brand2....)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 12:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153756#M30150</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-22T12:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Deriving Macro variable name from other macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153757#M30151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are defining a macro named filecheck and than using one filecheck_create.&amp;nbsp; Getting an error that is most likely caused by unbalanced apostrophes.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The things you have posted is inconsistent. Restart your eguide/sas-session and before submitting any code, review that carefully on colors indicating something coded badly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 13:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153757#M30151</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-22T13:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Deriving Macro variable name from other macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153758#M30152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW / Jaap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the issue is resolved and thanks for you both for quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry Jaap while giving example i hgave incorrect Macroname, but in the process i used corret name. The issue with trim function using for all the macro variables, thanks RW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 13:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153758#M30152</guid>
      <dc:creator>venkata_peddisetty</dc:creator>
      <dc:date>2014-09-22T13:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deriving Macro variable name from other macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153759#M30153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From your error message it looks like you have unbalanced quotes somewhere in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to the idea of building up macro variable names (or any other string) from macro variables you just need to reference the variables in the right place.&amp;nbsp; For example if you want to build the value for the Tablename parameter from all of those other macro variables then just reference them in order.&amp;nbsp; Tablename=&amp;amp;ini._&amp;amp;Fcode._brow_&amp;amp;brand2._&amp;amp;season2._&amp;amp;work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not work (say because it is producing spaces in the middle of what should be a table name) then the problem is in the individual macro variables and should be fixed when they are created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If what you wanted to build was not a table name, but instead the name of a macro variable that would actually hold the name of the table then you could add two extra &amp;amp;'s in front.&amp;nbsp; When SAS sees two adjacent &amp;amp;'s it resolves them to one &amp;amp; and then re-evaluates the results again for macro variable references.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 13:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deriving-Macro-variable-name-from-other-macro-variables/m-p/153759#M30153</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-22T13:39:02Z</dc:date>
    </item>
  </channel>
</rss>

