:ATTACH_SYNC

Use the :ATTACH_SYNC script statement to attach a Sync object to a task that has already been activated. This script statement assigns the Sync object temporarily, for the current execution only.

Important! :ATTACH_SYNC does not affect Script objects. Script objects are complete after their generation stage, and the synchronization process takes place at a later point in time.

Assigning a Sync Object to the Current Task

Omit the RunID in the parameters, or specify the RunID of the current task, to assign the Sync object to the current task.

More Information:

Assigning a Sync Object to a Different Task

Specify the RunID as a parameter of :ATTACH_SYNC to assign the Sync object to a different task than the task that contains the script.

Important! Only assign a Sync object to a different task that has already been activated if the task has one of the following statuses:

Any other task status results in a runtime error and the script is canceled.

Assigning a Sync Object to the Direct Successor in the Workflow

Use the NEXT_OBJECT parameter to assign the Sync object to the successor of the task in the Workflow, to influence further processing.

Notes:

Syntax

:ATTACH_SYNC [Object type,] [RunID], Sync object, [Start action], [Abend action], [End action], Other, [NEXT_OBJECT]

Parameters

Note: The Start, End and Abend actions are defined in the Sync object. For more information, see Sync (SYNC).

Examples

The following script adds a Sync object (SYSTEM_0001_EXCLUSIVE_SYNC) to a Job called ARCHIVE01. If the start action cannot be executed, the job ends abnormally.

:SET &RUNNR# = GET_UC_OBJECT_NR(ARCHIVE01)
:ATTACH_SYNC &RUNNR#,"SYSTEM_0001_EXCLUSIVE_SYNC","USE","RELEASE","RELEASE","A"

In the following example, the Sync object is assigned to the directly succeeding task in the Workflow.

:ATTACH_SYNC ,"SYSTEM_0001_EXCLUSIVE.SYNC","USE","RELEASE","RELEASE","A","NEXT_OBJECT"

See also:

seealso

Sync (SYNC)