<?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 Macro variable in the macro name error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647280#M193695</link>
    <description>&lt;P&gt;Hi SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need a help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that is resolving to client as abc in the log.But when i call that in a macro, i am getting the below error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;client is resolving correctly like example abc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro &amp;amp;client._call (parms = );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: Invalid macro name &amp;amp;. It should be a valid SAS identifier no longer than 32 characters.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 01:13:05 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2020-05-13T01:13:05Z</dc:date>
    <item>
      <title>Macro variable in the macro name error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647280#M193695</link>
      <description>&lt;P&gt;Hi SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need a help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro that is resolving to client as abc in the log.But when i call that in a macro, i am getting the below error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;client is resolving correctly like example abc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro &amp;amp;client._call (parms = );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: Invalid macro name &amp;amp;. It should be a valid SAS identifier no longer than 32 characters.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 01:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647280#M193695</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-05-13T01:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in the macro name error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647284#M193698</link>
      <description>&lt;P&gt;Looks like you are confusing defining a macro and calling a macro. You use the %MACRO statement only when defining the macro.&amp;nbsp; You have to give the macro an actual name when you defined it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymacro; ... %mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But you could use a macro variable to resolve to the name of the macro you want to call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let want_to_call = mymacro;
%&amp;amp;want_to_call;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 01:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647284#M193698</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-13T01:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in the macro name error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647285#M193699</link>
      <description>&lt;P&gt;Hi, are you trying do define a macro called abc&lt;SPAN&gt;_call (parms = ) or do you want to call the macro that is called abc_call? I am not sure if you can create a sas macro program name based on macro variables. But, that is just my guess. But, if you want to call a predefined macro based on a macro variable, that seem to be working.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let client=abc;

%macro abc_call (parms = );
	%put This is the inparameters &amp;amp;=parms;
%mend; 

%&amp;amp;client._call(parms=Hello World);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 01:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-the-macro-name-error/m-p/647285#M193699</guid>
      <dc:creator>heffo</dc:creator>
      <dc:date>2020-05-13T01:53:26Z</dc:date>
    </item>
  </channel>
</rss>

