Search code examples
sassas-macro

Generate SAS macro code without executing it


Is there a way I can print the SAS code generated by a macro without executing it?

Thanks


Solution

  • No, not in general. A macro is a program that generates SAS code, so the only way to know what code it's going to generate is to run it. In some very simple cases, you might be able to parse the macro and determine what SAS code will be generated, but for any more complex case, you'd have to re-implement a program to read, parse and execute a macro for this to work. See also the Halting Problem.