:PSET

The P in :PSET stands for Parent. Use the :PSET statement 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 action makes the script variable's value persistent, allowing it to be retrieved like any other object variable. Essentially, :PSET combines the assignment capabilities of :RSET with the publishing functionality of :PUBLISH (specifically when using the WORKFLOW scope).

Syntax

: PSET Object variable = Value

Parameters

Parameter Description Format
Object variable

Specifies the name of the object variable.

Follow the standard rules for variable names. For more information, see Variable Names.

Script variable
Value Defines the value assigned to both the script variable and its corresponding object variable. Arithmetic expression, script literal, script variable, or script function

Important Considerations

Keep the following rules and behaviors in mind when using the :PSET statement:

  • You can use the :PSET statement to persist script variables and their values as object variables in the current task and its parent, ensuring they are available for subsequent tasks.

  • To successfully pass variables, configure child tasks in a Workflow to inherit object variables from their parent. Enable the Inherit from parent setting on the Variables page in the child task's object definition.

  • Select the Generate Task at Runtime option in a subsequent task's object definition to ensure it retrieves the newly created or updated object variables from preceding tasks.

  • Important!

    • Always end the variable name with a delimiter, such as a hash (#). This practice prevents errors during child task generation when the object variable and the Workflow task share the same starting characters.

    • The system never passes script variable values set via the :PSET statement to Schedule or Period objects.

  • Activation Report: The :PSET statement behaves similarly to the :RSET statement by storing the script variable and its value in the activation report. Every value, including numerical data types like signed or float numbers, is stored strictly as text.

The system writes a line to the activation report using the following format:

YYYY-MM-DD HH:MM:SS - U00020206 Variable '&VAR#' was stored with the value 'VALUE'.

Examples

Consider a Workflow containing two objects: a File Transfer named MM.GET.FILES and a Job named MM.END.PROCESSING. Both objects utilize the Generate Task at Runtime setting. The File Transfer object evaluates its environment to select an appropriate Agent. When the subsequent Job runs, it must use this exact same Agent.

The following script statement updates the script variable &HOST# and its corresponding object variables (in both the File Transfer and the parent Workflow) to designate a specific UNIX Agent. Within the MM.END.PROCESSING Job's script, you can then use the inherited &HOST# object variable to accurately target the Agent:

: PSET &HOST# = "unix01"

Related Topics

See also:

seealso

GET_PUBLISHED_VALUE

:FILL