<?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 how to write a macro name including multiple macro variables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450511#M113427</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data eq1;
input ID y x z w;
cards;
1 1 30 . 25
3 1 . 45 . 
4 1 48 25 56 
;
run;

%macro genmod(method,missper);
proc genmod data = &amp;amp;&amp;amp;method&amp;amp;missper;
		class y(ref='0') id;
  		model y= x z w/ dist=bin link=logit pred covb;
		repeated subject=id / type=ar(1) PRINTMLE;
     
      	ods output ParameterEstimates=&amp;amp;&amp;amp;method.lgs&amp;amp;missper;
    run;
%MEND genmod;
%genmod(eq,1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am writing some MACRO. I know for above code example ( eq=method and missper=1 ), if I want to write 'eq1', I could use &amp;amp;&amp;amp;method&amp;amp;missper. But I want to know more complex writing way. For 'eqlgs1', I use &lt;SPAN&gt;&amp;amp;&amp;amp;method.lgs&amp;amp;missper. what about 'leq.gs1' or 'leq_1gs'? something like those. Any other way to write eqlgs1?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Apr 2018 02:38:14 GMT</pubDate>
    <dc:creator>xiangpang</dc:creator>
    <dc:date>2018-04-03T02:38:14Z</dc:date>
    <item>
      <title>how to write a macro name including multiple macro variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450511#M113427</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data eq1;
input ID y x z w;
cards;
1 1 30 . 25
3 1 . 45 . 
4 1 48 25 56 
;
run;

%macro genmod(method,missper);
proc genmod data = &amp;amp;&amp;amp;method&amp;amp;missper;
		class y(ref='0') id;
  		model y= x z w/ dist=bin link=logit pred covb;
		repeated subject=id / type=ar(1) PRINTMLE;
     
      	ods output ParameterEstimates=&amp;amp;&amp;amp;method.lgs&amp;amp;missper;
    run;
%MEND genmod;
%genmod(eq,1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am writing some MACRO. I know for above code example ( eq=method and missper=1 ), if I want to write 'eq1', I could use &amp;amp;&amp;amp;method&amp;amp;missper. But I want to know more complex writing way. For 'eqlgs1', I use &lt;SPAN&gt;&amp;amp;&amp;amp;method.lgs&amp;amp;missper. what about 'leq.gs1' or 'leq_1gs'? something like those. Any other way to write eqlgs1?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 02:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450511#M113427</guid>
      <dc:creator>xiangpang</dc:creator>
      <dc:date>2018-04-03T02:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a macro name including multiple macro variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450527#M113433</link>
      <description>&lt;P&gt;Use the macro without the proc genmod, just put a %put into it, so you can experiment until you get it right.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 06:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450527#M113433</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-03T06:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a macro name including multiple macro variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450704#M113516</link>
      <description>&lt;P&gt;You may want to test your macro coding with Options Mprint symbolgen; (turn off with Options Nomprint Nosymbolgen;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the rules for macro variable concatenation and the very significant difference between &amp;amp;var1&lt;FONT color="#ff0000" size="4"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/FONT&gt;&amp;amp;var2 and &amp;amp;&amp;amp;var1&amp;amp;var2.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/450704#M113516</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-03T15:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a macro name including multiple macro variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/451692#M113922</link>
      <description>&lt;P&gt;Here are a few examples from what you asked about:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put will write the resolved text to the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you use multiple &amp;amp;'s this is indirect referencing. Documentation: &lt;A href="http://go.documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n0vl7e3du5f7cjn1g4ajozqxe6b6.htm&amp;amp;locale=en" target="_blank"&gt;http://go.documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n0vl7e3du5f7cjn1g4ajozqxe6b6.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let method=eq;
%let missper=1;
%let method1=Hello;


/*eq1*/
%put  &amp;amp;method&amp;amp;missper;

/*eqlgs1*/
%put &amp;amp;method.lgs&amp;amp;missper;


/*leq.gs1*/
%put  l&amp;amp;method..gs&amp;amp;missper;

/*leq_1gs*/
%put l&amp;amp;method._&amp;amp;missper.gs;



/*When there are double ampersands in front of a macro variable, they are resolved to one ampersand. 
Then the next macro variable is resolved.
Finally the macro variable is rescanned and resolved. 
&amp;amp;&amp;amp;method&amp;amp;misper -&amp;gt; &amp;amp;method1 -&amp;gt; Hello
*/

%put &amp;amp;&amp;amp;method&amp;amp;missper;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 21:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-write-a-macro-name-including-multiple-macro-variables/m-p/451692#M113922</guid>
      <dc:creator>brzcol</dc:creator>
      <dc:date>2018-04-05T21:17:53Z</dc:date>
    </item>
  </channel>
</rss>

