When
the word scanner processes a program and finds a token in the form
of
&
or
%
,
it triggers the macro processor to examine the name token that follows
the
&
or
%
. Depending on the token, the macro processor initiates one of the
following activities:
-
macro variable resolution
-
macro open code processing
-
-
An error
can occur during any one of these stages. For example, if you misspell
a macro function name or omit a necessary semicolon, that is a
syntax error during compilation. Syntax errors occur
when program statements do not conform to the rules of the macro language.
Or, you might refer to a variable out of scope, causing a
macro variable resolution error.
Execution
errors (also called
semantic errors) are usually errors in program logic. They can occur, for example,
when the text generated by the macro has faulty logic (statements
not executed in the right order or in the way you expect).
Of course, even if your
macro code is perfect, that does not guarantee that you will not encounter
errors caused by plain SAS code. For example, you might encounter
the following:
-
a libref that is not defined
-
a syntax error in open code (that
is, outside of a macro definition)
-
a typo in the code that your macro
generates
Typically, error messages with numbers are plain SAS
code error messages. Error messages generated by the macro processor
do not have numbers.