:PSET

The P in :PSET stands for Restart. The :PSET statement allows you to assign a value or the result of an arithmetic expression to a script variable while simultaneously creating or updating an object variable with the same name for the current task and its parent. This makes the script variable's value persistent; this means that it can be retrieved like any other object variable. Essentially, :PSET combines the assignment capability of :RSET with the functionality of :PUBLISH (specifically, using WORKFLOW scope).

More Information:

Syntax

:PSETObject variable = Value

Parameters

  • Object variable
    Name of the object variable
    Format: script variable
    Follow the rules for variable names. For more information, see Variable Names.

  • value
    Value to assign to the object variable
    Format: Arithmetic expression, script literal, script variable, or script function

Usage

You can use the :PSET statement to persist script variables and their values as object variables in the current task and its parent, so that it can be used in subsequent tasks. For that, 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. You also may set the option Generate Task at Runtime in a subsequent task’s object definition to retrieve created or updated object variables from preceding tasks.

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.

  • Any value of a script variable that you set with the :PSET statement is never passed on to Schedule or Period objects.

Activation Report

The :PSET statement behaves like the :RSET statement and stores the script variable and its values in the activation report, too. Every value, including values of numeric types such as signed or float, will be stored as a text.

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'.

Example

A Workflow contains two objects. One is a File Transfer object that is called MM.GET.FILES, the other is a Job that is called MM.END.PROCESSING. In both objects, the Generate Task at Runtime setting is configured. Assume that the File Transfer object checks the environment to select the appropriate agent. When the subsequent Job runs, it uses this Agent, too.

The following script statement changes the script variable &HOST# and its corresponding object variables (the one in the File Transfer and the other in the Workflow) to a specific Unix agent. In the MM.END.PROCESSING Job, use the inherited object variable &HOST# in the script to select the Agent to run on:

:PSET  &HOST# = "unix01"

See also:

seealso

GET_PUBLISHED_VALUE

:FILL