Chapter Contents

Previous

Next
SAS Macro Language: Reference

Displaying Macro Variable Values

The simplest way to display macro variable values is to use the %PUT statement, which writes text to the SAS log. For example, the statements

%let a=first;
%let b=macro variable;
%put &a ***&b***;

write

first ***macro variable***

You can also use a %PUT statement to view available macro variables. %PUT provides several options that allow you to view individual categories of macro variables. %PUT is described in Chapter 13.

The system option SYMBOLGEN displays the resolution of macro variables. For this example, assume that macro variables PROC and DSET have the values GPLOT and SASUSER.HOUSES, respectively.

options symbolgen;
%let title "%upcase(&proc) of %upcase(&dset)";

The SYMBOLGEN option prints to the log:

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

For more information on debugging macro programs, see Chapter 10, "Macro Facility Error Messages and Debugging."


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.