On Mon, 2 Oct 2006 09:05:45 -0400, Peter Crawford
>On Mon, 2 Oct 2006 16:31:32 +1300, John Fouhy <john@FOUHY.NET> wrote:
>>On 02/10/06, Ian Whitlock <email@example.com> wrote:
>>I found your post quite interesting. I have one quesiton; you said:
>>> All of the above work has been tested to see that the expected
>>> SAS code is generated, i.e. the macro algorithms work. I have
>>> not tested that the SAS code also works, but I do not see
>>> anything wrong with the generated code.
>>How can I easily see the SAS code generated by a macro? I know I can
>>turn MPRINT on, but then I need to do further manual processing if I
>>want to create SAS executable code. Is there an easy way to get the
>>executable code produced by a macro?
>you can capture the text generated by macros by using the option
>This defaults to NOmfile.
>When the options MPRINT and MFILE are "on", and a "filename" is
>allocated with the fileref MPRINT, the MFILE option writes a copy
>of the text/code generated by macros to the file allocated with
That seems like the best solution, but the RESOLVE function can also be
exploited, and might make sense for the scenario where there are a lot of
Try this demo:
Result will embed passed-in values &a and &b!
macroresult = resolve('%test(eenie,meenie)');
It should print
macroresult=Result will embed passed-in values eenie and meenie!