Figure 2.3 The Word Scanner Obtains Tokens
The compiler continues to pull tokens until it recognizes the end of the DATA step (in
this case, the RUN statement), which is called a DATA step boundary, as shown in the
following figure. When the DATA step compiler recognizes the end of a step, the step is
executed, and the DATA step is complete.
Figure 2.4 The Word Scanner Sends Tokens to the Compiler
In most SAS programs with no macro processor activity, all information that the
compiler receives comes from the submitted program.
How SAS Processes Statements with Macro
Activity
In a program with macro activity, the macro processor can generate text that is placed on
the input stack to be tokenized by the word scanner. The example in this section shows
you how the macro processor creates and resolves a macro variable. To illustrate how the
compiler and the macro processor work together, the following figure contains the macro
processor and the macro variable symbol table. SAS creates the symbol table at the
beginning of a SAS session to hold the values of automatic and global macro variables.
SAS creates automatic macro variables at the beginning of a SAS session. For the sake
of illustration, the symbol table is shown with only one automatic macro variable,
SYSDAY.
18 Chapter 2 • SAS Programs and Macro Processing