:SET

Use the :SET statement to assign a value to a variable. You can use :SET on its own, or can combine it with the :DEFINE statement to declare the data type of the variable. If you use :SET alone, the variable can only store strings or positive integers, and is not tied to a particular data type. You can also use :SET to solve an arithmetic expression.

More Information:

Syntax

:S[ET] Script variable = Value

Parameters

Notes:

Important! You can use :SET and :RSET to assign different values to the same script variable. The values are set by those statements when you execute the Job. If you restart the Job, the value that the :RSET statement previously stored in the report is used.

Examples

The following example assigns a string to a script variable called &FILENAME#:

:SET &FILENAME# = "L.LST.FILE"

The following example uses the SYS_DATE script function to retrieve the current date, and assigns that date to a script variable called &TODAY#:

:SET &TODAY# = SYS_DATE(YYMMDD)

The following example assigns a numerical value to a script variable:

:SET &NUMBER# = 1

The following example assigns the value of one script variable to another variable:

:SET &NR# = &NUMBER#

See also:

seealso

:DEFINE

seealso1

RESOLVE_VAR