Search notes:

SAS: Program compilation - tokens

During the compilation process, tokens are recognized by the word scanner.
The identified tokens are pushed to the word queue.

Different types of tokens

There are different types of tokens:

End of a token sas-end-of-token

The word scanner recognizes the end of a token by a white space, the two macro triggers (%, &), by the dot (.) or by a special token (+, ; …).

Macro triggers

If the word scanner fetches a macro trigger (% or &), it does not push the next token to the word queue.
Rather, it invokes the (multi-component) macro processor to process them further.
The macro processor might push text into the input stack.
For example, if the condition of an %if statement is met, the corresponding text is pushed back.
Similarly, a %do statement might push text multiple times to the input stack.

Index