:RSET
Use the :RSET statement to assign a value to a script variable and store the value in the activation report. The stored value is available if you subsequently restart the task.
The line that is written to the activation report looks like the following example:
YYYY-MM-DD HH:MM:SS - U00020206 Variable '&VAR#' was stored with the value 'VALUE'.
You can use the value that the :RSET statement stores in the activation report in the following ways:
-
Use stored values from the activation report
Use :RSET when you want to restart a task with the stored value from the activation report. Otherwise, no value assignment takes when you restart the task. Activation is canceled if the relevant script variable cannot be found. If a value has been stored multiple times, and there is no warning message, then the last stored value is used. For more information about activation reports, see Understanding the Reports. -
Pass values to the Post Process page
Use :RSET to pass the value of a script variable from the Process page to the Post Process page of a Job:- Assign the value of the script variable on the Process page.
- The script statement automatically assigns the value that was last stored in the activation report.
-
Generate object variables that are passed to child tasks in a Workflow
Use :RSET in the script of a Workflow object to generate an object variable. The object variable can be passed to child tasks of the Workflow. Define object variables on the Variables page in the object definition, or use the :PSET script statement.
Note: You must configure child tasks in a Workflow to inherit object variables from the parent. Use the Inherit from parent setting on the Variables page in the object definition of the child task.
Important! End the variable name with a delimiter such as a hash. This avoids errors when generating child tasks where the names of the object variable and the workflow task start with the same characters.
More Information:
Syntax
:RSET Script variable [= Value]
Parameters
-
:RSET
Assigns a value to the script variable and stores the value in the activation report -
Script variable
Name of the script variable to assign the value to
Format: script variable
Follow the rules for variable names. For more information, see Variable Names. -
value
Value that is assigned to the script variable
Format: script literal, number, script variable, or script function
Notes:
- Signed and float data types are automatically converted to string data types when the value is stored in the activation report.
- Unsigned data types are not converted.
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.
Example
The following example shows how to assign a value to a script variable on the Process page of a Job. The variable is used on the Post Process page of the same Job.
Write the following script lines on the Process page of the Job:
:RSET &TEXT# = "test"
:SET &NUMBER# = 1
:RSET &NUMBER# = ADD(&NUMBER#,1)
The :RSET statements adds 1 to the number defined by the :SET statement.
Write the following script lines on the Post Process page of the same Job:
:PRINT &TEXT#
:PRINT &NUMBER#
The values (test and 2) are transferred to the Post Process page of the Job and written to the activation report.
Tip: You can use the :RSET and :READ script statements to store values of script variables in reports.
See also: