#7 @5 'Enter /// when you are finished.'
#9 @5 val 100 attr=underline;
%macro ask2;
%global myprob;
%local temp;
%do %until(%superq(val) eq %str(///)); /* No ampersand */
%display ask;
%let temp=&temp %superq(val); /* No ampersand */
%end;
%let myprob=&temp
%mend ask2;
You can invoke the macro ASK2 and enter a response:
%ask2
Try entering:
My macro ADDRESS starts with %MACRO ADDRESS(COMPANY,
CITY);. I called it with %ADDRESS(SMITH-JONES, INC., BOSTON),
but it said I had too many parameters. What happened?
///
The response contains a macro language keyword, a macro invocation, and unmatched
parentheses.
Summary of Macro Quoting Functions and the
Characters That They Mask
Different macro quoting functions mask different special characters and mnemonics so
that the macro facility interprets them as text instead of as macro language symbols.
The following table divides the symbols into categories and shows which macro quoting
functions mask which symbols.
Table 7.6 Summary of Special Characters and Macro Quoting Functions by Item
Group Items Macro Quoting Functions
A + — */<>=¬^|~;, # blank AND OR
NOT EQ NE LE LT GE GT IN
all
B &% %NRSTR, %NRBQUOTE,
%SUPERQ, %NRQUOTE
C unmatched' “() %BQUOTE, %NRBQUOTE,
%SUPERQ, %STR*, %NRSTR*,
%QUOTE*, %NRQUOTE*
96 Chapter 7 Macro Quoting

Get SAS 9.4 Macro Language, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.