Macro variables are stored in symbol tables, which list the macro variable name and its
value. There is a global symbol table, which stores all global macro variables. Local
macro variables are stored in a local symbol table that is created at the beginning of the
execution of a macro.
You can use the %SYMEXIST function to indicate whether a macro variable exists. For
more information, see “%SYMEXIST Function” on page 278.
Global Macro Variables
The following code illustrates the global symbol table during execution of the following
program:
%let county=Clark;
%macro concat;
data _null_;
length longname $20;
longname="&county"||" County";
put longname;
run;
%mend concat;
%concat
Calling the macro CONCAT produces the following statements:
data _null_;
length longname $20;
longname="Clark"||" County";
put longname;
run;
The PUT statement writes the following to the SAS log:
Clark County
Figure 5.1 Global Symbol Table
Global macro variables include the following:
50 Chapter 5 Scopes of Macro Variables
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset