Chapter Contents

Previous

Next
%SUPERQ

%SUPERQ



Masks all special characters and mnemonic operators at macro execution but prevents further resolution of the value

Type: Macro quoting function
See also:
%NRBQUOTE
%BQUOTE and %NRBQUOTE


Syntax
Details
Comparisons
Example
Passing Unresolved Macro Variable Values

Syntax

%SUPERQ (argument)

argument
is the name of a macro variable with no leading ampersand or a text expression that produces the name of a macro variable with no leading ampersand.


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

Example 1: Passing Unresolved Macro Variable Values

In this example, %SUPERQ prevents the macro processor from attempting to resolve macro references in the values of MV1 and MV2 before assigning them to macro variables TESTMV1 and TESTMV2.

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.