I am using nested global macros within a foreach loop
I want to access the global name (to use it for labeling estimate outputs)
Please help!
I have a series of nested macros;
which are then nested in a list of all possible combinations to be used in the foreach loop;
this works fine but I want to access the active global name within each loop - to assign to estimates - something like
where I would hope the estimate file name to be;
NBREG_GRP1
NBREG_GRP2
...
NBREG_GRP123
(i.e. the elements listed in $ALL)
i have tried many combinations of `'; $; {} to no avail - and exhausted general searches for solutions.
I'd be grateful for any ideas
I want to access the global name (to use it for labeling estimate outputs)
Please help!
I have a series of nested macros;
Code:
global GRP1 "1 2 3 4" global GRP2 "5 6 7" global GRP3 "8 9 10 11 12" global GRP12 "\$GRP1 \$GRP2" global GRP13 "\$GRP1 \$GRP3" ... global GRP123 "\$GRP1 \$GRP2 \$GRP3"
Code:
global ALL "\$GRP1 \$GRP2 .... \$GRP12 ... \$GRP123" foreach X of global ALL { tokenize `X' local e_list "" while "`*'"!="" { local e "i.`1'" local e_list "`e_list' `e'" macro shift } nbreg DEP `e_list'
Code:
est save NBREG_`\X'
NBREG_GRP1
NBREG_GRP2
...
NBREG_GRP123
(i.e. the elements listed in $ALL)
i have tried many combinations of `'; $; {} to no avail - and exhausted general searches for solutions.
I'd be grateful for any ideas
Comment