Syntax errors result if the
arguments of %STR, %NRSTR, %QUOTE, and %NRQUOTE contain a quotation
mark or parenthesis that does not have a match. To prevent these errors,
mark these quotation marks and parentheses by preceding them with
a percent sign. For example, write the following to store the value
345)
in macro variable B:
If an argument of %STR,
%NRSTR, %QUOTE, or %NRQUOTE contains a percent sign that precedes
a quotation mark or parenthesis, use two percent signs (%%) to specify
that the argument's percent sign does not mark the quotation mark
or parenthesis. For example, Write the following to store the value
TITLE "20%";
in macro variable P:
%let p=%str(TITLE "20%%";);
If the argument for
one of these functions contains a character string with the comment
symbols
/*
and
-->
, use a %STR function with each character. For example, consider
these statements:
%let instruct=Comments can start with %str(/)%str(*).;
%put &instruct;
They write the following
line to the SAS log:
Comments can start with /*
Note: Unexpected results can occur
if the comment symbols are not quoted with a quoting function.