Previous Page | Next Page

System Options for Macros

SYMBOLGEN System Option



Specifies whether the results of resolving macro variable references are written to the SAS log for debugging.
Valid in:

Configuration file

OPTIONS window

OPTIONS statement

SAS invocation

Type: System option
Alias: SGEN | NOSGEN
Default: NOSYMBOLGEN
PROC OPTIONS GROUP= MACRO
LOGCONTROL
See Also: The SAS Log

Syntax
Details
Example
Tracing Resolution of Macro Variable References

Syntax

SYMBOLGEN | NOSYMBOLGEN

SYMBOLGEN

displays the results of resolving macro variable references. This option is useful for debugging.

NOSYMBOLGEN

does not display results of resolving macro variable references.


Details

SYMBOLGEN displays the results in this form:

SYMBOLGEN: Macro variable name resolves to value

SYMBOLGEN also indicates when a double ampersand (&& ) resolves to a single ampersand (& ).


Example


Example 1: Tracing Resolution of Macro Variable References

In this example, SYMBOLGEN traces the resolution of macro variable references when the macros MKTITLE and RUNPLOT execute:

%macro mktitle(proc,data);
    title "%upcase(&proc) of %upcase(&data)";
%mend mktitle;

%macro runplot(ds);
   %if %sysprod(graph)=1 %then
      %do;
         %mktitle (gplot,&ds)
         proc gplot data=&ds;
            plot style*price
                / haxis=0 to 150000 by 50000;
         run;
         quit;
      %end;
   %else
      %do;
         %mktitle (plot,&ds)
         proc plot data=&ds;
            plot style*price;
         run;
         quit;
      %end;
%mend runplot;

%runplot(sasuser.houses)

When this program executes, this SYMBOLGEN output is written to the SAS log:

SYMBOLGEN:  Macro variable DS resolves to sasuser.houses
SYMBOLGEN:  Macro variable PROC resolves to gplot
SYMBOLGEN:  Macro variable DATA resolves to sasuser.houses
SYMBOLGEN:  Macro variable DS resolves to sasuser.houses

Previous Page | Next Page | Top of Page