I think for your problem you don't even need a nested macro definition.
Just one macro with varying contents of macro variables will do. Nesting
macro definitions only makes sense of you inner macro will have varying
contents, based on conditions in the outer macro. See als my example in the
(two line) URL:
Regards - Jim.
Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL
Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign)
My computer always teaches me something new I thought I knew already.
On Sun, 17 Jul 2005 00:57:31 +0200, majkel <caatcher@GAZETA.PL> wrote:
>I am trying to construct one macro by means of another. What I want to
>achieve is to create an inner macro that would be independent from the
>macro, by means of which it was created. In this example:
> %macro inner;
> title "Statistics for year &year";
> %mend inner;
>everything works fine, as I resolve to the %inner macro within the body of
>the %outer macro. When the %inner macro is executed beyond the %outer (and
>assuming that there is no other variable called &year), the variable &year
>is unknown - which is obvious.
> What I am trying to achieve, is to define the body of the inner macro,
>so that the &year variable is resolved BEFORE the %inner macro is compiled,
>so that the &year variable does not have to be resolved each time, the
>%inner macro is executed.
>Another attempt to do that was:
> %let text=%nrstr(%%macro inner;);
> %let text=&text %nrstr(title %"Statistics for year)&year%nrstr(%";);
> %let text=&text %nrstr(%%mend;);
>But it did not work due to compilation errors :((
>Does anyone has any idea how to do that? Is it possible at all??
>I will be very thankful for any help.