SAS Global Forum – 1444/5/6 SAS Macros

How does Macro language work and why.

It is a code generator!

three levels

1 Code substitution
2 Macro statements
3 Dynamic programming

Timing is key to understanding how MACROS work.

Run; or Quit; or new Step triggers timing boundaries

The scope and persistence of macros is complex but critical

They will have a Global table and may / may not have local symbol tables.

Use %Global and %Local to force the issue and avoid uncertainty.

Remember macro variables can exist in more than one symbol table with different values!

This entry was posted in Data Analytics, Richard Self, SAS Programming. Bookmark the permalink.