RESOLVE_VAR
Use the RESOLVE_VAR script function to resolve a variable in text. The system tries to resolve any type of variable:
- PromptSet variables
- System variables
- Script variables
- VARA objects
Syntax
RESOLVE_VAR (Variable)
-
RESOLVE_VAR
Resolves the value of a variable -
Variable
Name of the variable or VARA object to resolve
Format: Script literal or script variable
Examples
An SQLI VARA object called VARA.SQLI_TEST includes SQL that returns version and build numbers. A script in a Job resolves the SQLI VARA object in a text. The script assigns the resulting phrase ("This is version" followed by the retrieved version number) as the value of a script variable.
:SET &txt# = RESOLVE_VAR("This is version {VARA.SQLI_TEST}")
:PRINT &txt#
The script prints the script variable in a report:
2014-11-18 11:50:22 - U00020408 This is version 11.0.0+build.2751
The following example retrieves and resolves a variable. Assume that the value stored in the VARA object VARA_RESOLVE (key 1, value 1) is a phrase ("this is the main key").
:SET &var# = {VARA_RESOLVE,key1,1}
:PRINT &var#
:SET &val# = RESOLVE_VAR(&var#)
:PRINT &val#
The script prints the following lines in the report:
2014-11-18 17:50:32 - U00020408 {VARA_RESOLVE,key1,1}
2014-11-18 17:50:32 - U00020408 this is the main key
See also: