SAS now sees this statement:
DATA SALES1 SALES2;
Creating a Period to Follow Resolved Text
Sometimes you need a period to follow the text resolved by the macro processor. For
example, a two-level data set name needs to include a period between the libref and data
set name.
When the character following a macro variable reference is a period, use two periods.
The first is the delimiter for the macro reference, and the second is part of the text.
set in&name..temp;
After macro variable resolution, SAS sees this statement:
SET INSALES.TEMP;
You can end any macro variable reference with a delimiter, but the delimiter is necessary
only if the characters that follow can be part of a SAS name. For example, both of these
TITLE statements are correct:
title "&name.--a report";
title "&name--a report";
They produce the following:
TITLE "sales--a report";
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 following statements write the following
result:
%let a=first;
%let b=macro variable;
%put &a ***&b***;
Here is the result:
first ***macro variable***
You can also use a “%PUT Statement” on page 332 to view available macro variables.
%PUT provides several options that enable you to view individual categories of macro
variables.
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;
title "%upcase(&proc) of %upcase(&dset)";
The SYMBOLGEN option prints to the log:
SYMBOLGEN: Macro variable PROC resolves to gplot
SYMBOLGEN: Macro variable DSET resolves to sasuser.houses
Displaying Macro Variable Values 35
..................Content has been hidden....................

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