Chapter Contents

Previous

Next
RESOLVE

RESOLVE



Resolves the value of a text expression during DATA step execution

Type: SAS function


Syntax
Details
Comparisons
Example
Resolving Sample References

Syntax

RESOLVE(argument)

argument
can be


Details

The RESOLVE function returns a character value that is the maximum length of a DATA step character variable unless you explicitly assign the target variable a shorter length. A returned value that is longer is truncated.

If RESOLVE cannot locate the macro variable or macro identified by the argument, it returns the argument without resolution and the macro processor issues a warning message.

You can create a macro variable with the SYMPUT routine and use RESOLVE to resolve it in the same DATA step.


Comparisons


Example

Example 1: Resolving Sample References

This example shows RESOLVE used with a macro variable reference, a macro invocation, and a DATA step variable whose value is a macro invocation.

%let event=Holiday;
%macro date;
   New Year
%mend date;

data test;
   length var1-var3 $ 15;
   when='%date';
   var1=resolve('&event'); /* macro variable reference */
   var2=resolve('%date');  /* macro invocation */
   var3=resolve(when);     /* DATA step variable with macro invocation */

   put var1=  var2=  var3=;
run;

Executing this program writes these lines to the SAS log:

VAR1=Holiday  VAR2=New Year  VAR3=New Year
NOTE: The data set WORK.TEST has 1 observations and 4 variables.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.