When you submit a macro definition, the macro processor compiles the definition and
produces a member in the session catalog. The member consists of compiled macro
program statements and text. The distinction between compiled items and noncompiled
(text) items is important for macro execution. Examples of text items include:
• macro variable references
• nested macro calls
• macro functions, except %STR and %NRSTR
• arithmetic and logical macro expressions
• text to be written by %PUT statements
• field definitions in %WINDOW statements
• model text for SAS statements and SAS windowing environment commands
When you want to call the macro, you use the form
%macro_name.
Note: If your macro_text contains passwords that you want to prevent from being
revealed in the SAS log, redirect the SAS log to a file. For more information, see
“PRINTTO Procedure” in Base SAS Procedures Guide.
How the Macro Processor Compiles a Macro
Definition
When you submit a SAS program, the contents of the program goes to an area of
memory called the input stack. The example program in the following figure contains a
macro definition, a macro call, and a PROC PRINT step. This section illustrates how the
macro definition in the example program is compiled and stored.
Figure 4.1 The Macro APP
Using the same process described in Chapter 2, “SAS Programs and Macro Processing,”
on page 15 the word scanner begins tokenizing the program. When the word scanner
40 Chapter 4 • Macro Processing