![]() Chapter Contents |
![]() Previous |
![]() Next |
| %SUPERQ |
| Type: | Macro quoting function | ||
| See also: |
|
| Syntax | |
| Details | |
| Comparisons | |
| Example | |
| Passing Unresolved Macro Variable Values | |
Syntax |
| %SUPERQ (argument) |
| Details |
The %SUPERQ function returns the value of a macro variable without attempting to resolve any macros or macro variable references in the value. %SUPERQ masks the following special characters and mnemonic operators:
& % ' " ( ) + - * / < > = ¬ ^ ~ ; , blank AND OR NOT EQ NE LE LT GE GT
%SUPERQ is particularly useful for masking macro variables that might contain an ampersand or a percent sign when they are used with the %INPUT or %WINDOW statement, or the SYMPUT routine.
For a description of quoting in SAS macro language, see Chapter 7 in SAS Macro Language: Reference.
| Comparisons |
| Example |
data _null_;
call symput('mv1','Smith&Jones');
call symput('mv2','%macro abc;');
run;
%let testmv1=%superq(mv1);
%let testmv2=%superq(mv2);
%put Macro variable TESTMV1 is &testmv1;
%put Macro variable TESTMV2 is &testmv2;
Executing this program writes these lines to the SAS log:
Macro variable TESTMV1 is Smith&Jones Macro variable TESTMV2 is %macro abc;
You might think of the values of TESTMV1 and TESTMV2
as "pictures" of the original values of MV1 and MV2. The %PUT
statement then writes the pictures in its text. Because the macro processor
does not attempt resolution, it does not issue a warning message for the unresolved
reference
&JONES or an error message for beginning a macro
definition inside a %LET statement.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.