After wrestling with macros for a while I have settled on three types distinguished by a naming convention: %proc_something() is syntactically equivalent to a PROC and does execute. %SAS_something() or %stmt_something() is syntactically equivalent to a statement or part of a statement, and therefore does not execute. %something() or %fsomething() is a function and is syntactically equivalent to a string, number or identifier, and therefore does not execute. The second two follow your rules. That leads me to an idea: why not explicitly declare a macro to be a pure function (only macro code) or any collection of SAS code? The macro compiler could police this and the result would be more robust code. The obvious syntax is %macro /function name or %macro /sub name. Even better would be to declare the function return type, but the SAS language itself is vague about this.