RESTART_UC_OBJECT

Use the RESTART_UC_OBJECT script function to repeat the execution of a task. This function restarts a task that has already been executed. You can optionally specify restart points and set flags to provide instructions for the execution of the task.

Note: This script function writes all open transactions of the script to the AE database. For more information, see Script Processing.

Important: If you use this script function on the Post Process page, a task can repeat itself and cause an infinite loop.

Syntax

RESTART_UC_OBJECT (Object Name, Reference RUN#, [Restart Point], [Flags], [Queue])

Parameters

  • RESTART_UC_OBJECT
    Repeats the execution of a task

  • Object Name
    Name of the task to repeat

  • Reference RUN#
    RunID of the execution to repeat
    Format: Script literal, number, script variable or script function
    Use the LAST keyword if you want to repeat the last execution of the object.
    Note: You cannot restart a task that has already been restarted, so the RunID must refer to an original execution, not to a restart.

  • Restart Point
    (Optional) Point in the script at which to restart the execution
    Format: AE name, script literal, number or script variable
    Note: You can only specify this parameter if you have defined restart points in the script. For more information, see :RESTART. If you do not specify a restart point, then the whole script is used.

  • Flags
    (Optional) Comma-separated instructions for the execution
    The flags correspond to the Test Options when you manually restart a task. For more information, see Restarting Tasks.
    Format: Script literal or script variable
    Notes:

    • You can include multiple flags.
    • If you name the flags and do not use script variables, write the whole term in quotation marks.
    Allowed values:
    • GEN_JCL
      Displays the generated JCL in the activation report
    • ORIGINAL_SCRIPT
      Displays the original script in the activation report
    • VAR_MOD
      Displays changes to variables in the activation report
    • ATT_MOD
      Displays changes to attributes in the activation report
    • ATT_DIALOG
      Activates the Attribute dialog
    • MAN_RELEASE
      Waits for manual release from the Process Monitoring perspective
    • KEEP_STARTTYPE
      Retains the original start type
    • ONLY_ABENDED
      Only restarts child tasks that were canceled

  • Queue
    Specifies a Queue object to use when restarting the task
    If you do not specify a Queue object, the task is executed in the queue that is defined in the object.

Return Codes

The script function has the following return codes:

  • 0
    Successful restart
  • 7014
    Reference RunID does not exist
  • 7015
    Cannot restart an execution that has already been restarted
  • 20346
    Restart point does not exist
  • 20380
    Script processing in the restarted execution has been ended by an :EXIT statement
  • 20385
    Object is a Schedule object
  • 20628
    Object does not exist

Tip: Use the :ON_ERROR script statement to define what happens when an error occurs. For more information, see Error Handling in Scripts.

Example

The following example repeats the last execution of a Job (JOBS.SYSTEM.CHECK). The script function includes parameters to output the generated JCL and modified variables in the activation report. The last parameter instructs the Job to wait in the Process Monitoring perspective until you manually release the Job.

:SET &RET# = RESTART_UC_OBJECT ("JOBS.SYSTEM.CHECK",LAST,,"GEN_JCL,VAR_MOD,MAN_RELEASE")

See also: