You can create a read-only local macro variable and assign a specified value to it using
the READONLY option in a %LOCAL statement. Existing macro variables cannot be
made read-only. The value of the variable cannot be changed, and the variable cannot be
deleted. All read-only macro variables persist until the scope in which they exist is
deleted. For more information, see “%LOCAL Statement” on page 323.
You can use the %SYMLOCAL function to indicate whether an existing macro variable
resides in an enclosing local symbol table. For more information, see the
“%SYMLOCAL Function” on page 280.
Writing the Contents of Symbol Tables to the SAS
Log
While developing your macros, you might find it useful to write all or part of the
contents of the global and local symbol tables to the SAS log. To do so, use the %PUT
statement with one of the following options:
_ALL_
describes all currently defined macro variables, regardless of scope. This output
includes user-defined global and local variables as well as automatic macro
variables. Scopes are listed in the order of innermost to outermost.
_AUTOMATIC_
describes all automatic macro variables. The scope is listed as AUTOMATIC. All
automatic macro variables are global except SYSPBUFF. For more information
about specific automatic macro variables, see “Automatic Macro Variables” on page
167.
_GLOBAL_
describes all global macro variables that were not created by the macro processor.
The scope is listed as GLOBAL. Automatic macro variables are not listed.
_LOCAL_
describes user-defined local macro variables defined within the currently executing
macro. The scope is listed as the name of the macro in which the macro variable is
defined.
_READONLY_
describes all user-defined read-only macro variables, regardless of scope. The scope
is either GLOBAL, for global macro variables, or the name of the macro in which
the macro variable is defined.
_USER_
describes all user-defined macro variables, regardless of scope. The scope is either
GLOBAL, for global macro variables, or the name of the macro in which the macro
variable is defined.
_WRITABLE_
describes all user-defined read and write macro variables, regardless of scope. The
scope is either GLOBAL, for global macro variables, or the name of the macro in
which the macro variable is defined.
For example, consider the following program:
%let origin=North America;
%macro dogs(type=);
data _null_;
Writing the Contents of Symbol Tables to the SAS Log 53
..................Content has been hidden....................

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