Chapter Contents |
Previous |
Next |
SAS Macro Language: Reference |
Before the macro processor creates a variable, assigns a value to a variable, or resolves a variable, the macro processor searches the symbol tables to determine whether the variable already exists. The search begins with the most local scope and, if necessary, moves outward to the global scope. The request to assign or resolve a variable comes from a macro variable reference in open code (outside a macro) or within a macro.
Figure 5.3 illustrates the search order the macro processor uses when it receives a macro variable reference that requests a variable be created or assigned. Figure 5.4 illustrates the process for resolving macro variable references. Both these figures represent the most basic type of search and do not apply in special cases, such as when a %LOCAL statement is used or the variable is created by CALL SYMPUT.
Search Order When Assigning or Creating Macro Variables
Search Order When Resolving Macro Variable References
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.