When you use the %PUT
statement to list macro variable descriptions, the %PUT statement
includes only the macro variables that exist at the time the statement
executes. The description contains the macro variable's scope, name,
and value. Macro variables with null values show only the scope and
name of the variable. Characters in values that have been quoted
with macro quoting functions remain quoted. Values that are too long
for the current line size wrap to the next line or lines. Macro variables
are listed in order from the current local macro variables outward
to the global macro variables.
Note: Within a particular scope,
macro variables might appear in any order, and the order might change
in different executions of the %PUT statement or different SAS sessions.
Do not write code that depends on locating a variable in a particular
position in the list.
The following figure
shows the relationship of these terms.
The %PUT statement displays
text in different colors to generate messages that look like ERROR,
NOTE, and WARNING messages generated by SAS. To display text in different
colors, the first word in the %PUT statement must be ERROR, NOTE,
or WARNING, followed immediately by a colon or a hyphen. You might
also use the national-language equivalents of these words. When you
use a hyphen, the ERROR, NOTE, or WARNING word is blanked out.
Tip
If you place an equal sign
between the ampersand and the macro variable name of a direct macro
variable reference, the macro variable's name displays in the log
along with the macro variable's value.
%let x=1;
%put &=x;
X=1;