ABSTRACT

This chapter introduces macros, programs that can be used to write programs, and macro variables. Macro code is processed before the SAS compiler is invoked. It is a powerful text processing facility that can be used to assist with writing SAS programs. Initially, macro variables are introduced as a simple way to generalize programs where much of the code will be reused with minor changes. Macros are code modules that can be used to generate SAS code based on parameters. Conditional execution and looping in macro programs are introduced along with options for debugging macro programs are introduced.