I have been trying to create some useful autocall macros for use in future programs and I have run into a bit of an implementation problem.
I am trying to create a macro that will take the first parameter to determine the type of variables to create and the second parameter to declare what values to assign the variables. Here is what I have so far with a month example
The problem is that %ifvar creates parm1 and parm2 in its local table so the new variables all get created there and when I try to pass it to the outer table in a dummy macro it comes out empty. I am able to get them to pass to an outer table if I take out the parameters and simply declare them with a %local and %let statement in the outer macro but this seems to defeat the purpose of parameters.
Any suggestions for how to deal with this or advice on what I am doing wrong? I am trying to avoid having to declare a global variable list each time this macro is run to keep things tight but I am thinking that may be the only answer.
This is nothing to do with either nesting of macros, passing parameters or symbol tables. This is so simple in macro that I am not even sure these deserve to be autocall'ed. Hope this helps.
%put %mon2mm(Jan) %mon2mm(Feb) %mon2mm(Mar) %mon2mm(Nov) %mon2mm(Dec);
%put %mm2mon(01) %mm2mon(2) %mm2mon(3) %mm2mon(11) %mm2mon(12);
%*-- on log
01 02 03 11 12
Jan Feb Mar Nov Dec