General form, OPTIONS
statement with SYMBOLGEN option:
OPTIONS NOSYMBOLGEN | SYMBOLGEN;
NOSYMBOLGEN
specifies that log
messages about macro variable references are not displayed. This is
the default.
SYMBOLGEN
specifies that log
messages about macro variable references are displayed.
|
amount
, city
,
and company
, and you submit the following
code: data new; set sasuser.all; where fee>&amount; where also city_state contains "&city"; where also student_company contains '&company'; run;
110 where fee>&amount; SYMBOLGEN: Macro variable AMOUNT resolves to 975 111 where city_state contains "&city"; SYMBOLGEN: Macro variable CITY resolves to Dallas 112 where student_company contains '&company'; |
'&company'
). Because
this macro variable reference is enclosed in single quotation marks
rather than in double quotation marks, the word scanner does not call
the macro facility to resolve it.
General form, basic
%PUT statement:
%PUT text;
text
is any text string.
|
city
.
Since the %PUT statement resolves macro references in text before
writing text to the SAS log, you can use it to show the stored value
of city
. %put The value of the macro variable CITY is: &city;
120 %put The value of the macro variable CITY is: &city; The value of the macro variable CITY is: Dallas |
&put &city;
without
any additional text. This statement writes the resolved value of the
macro variable city
to the SAS log.
However, it does not write any additional text to the log. You might
find that it is a good idea to add explanatory text to your %PUT statements
in order to maintain clarity in the SAS log. The %PUT statement has
several optional arguments that you can add.
Argument
|
Result in SAS Log
|
---|---|
_ALL_
|
Lists the values of
all macro variables
|
_AUTOMATIC_
|
Lists the values of
all automatic macro variables
|
_LOCAL_
|
Lists user-generated
local macro variables
|
_USER_
|
Lists the values of
all user-defined macro variables
|
121 %let year=2002; 122 %let city=New York; 123 %let region=South; 124 %put _all_; GLOBAL YEAR 2002 GLOBAL REGION South GLOBAL CITY New York AUTOMATIC AFDSID 0 AUTOMATIC AFDSNAME AUTOMATIC AFLIB AUTOMATIC AFSTR1 AUTOMATIC AFSTR2 AUTOMATIC FSPBDV AUTOMATIC SYSBUFFR AUTOMATIC SYSCC 0 AUTOMATIC SYSCHARWIDTH 1 AUTOMATIC SYSCMD AUTOMATIC SYSDATE 29MAY02 |