RESTART_UC_OBJECT

Script Function: Repeats the execution of a task.

Syntax

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

Syntax

Description/Format

Object Name

Name of the object.
Format: script literal, script variable or script function

Reference Run#

RunID to which the restart refers, or the keyword LAST for the object's last execution.
Format: script literal, number, script variable or script function

You cannot repeat a task that has already been restarted because traces would become very difficult. Therefore, the RunID must refer to an original execution. The latest original execution is used in combination with the keyword LAST.

Restart Point

Point in the script from which execution should be restarted.
Format: AE name, script literal, number, script variable

This parameter can only be specified if you have specified restart points using :RESTART in the task that should be repeated.

The complete script is processed if this parameter is not used.

Flags

Instructions for the task execution.
Format: script literal or script variable

Allowed values:
GEN_JCL = Supplies the generated JCL in the activation report.
ORIGINAL_SCRIPT = Supplies the original script in the activation report.
VAR_MOD = Supplies the modification of variables in the activation report.
ATT_MOD = Supplies the modification of attributes in the activation report.
ATT_DIALOG = Activates the Attribute Dialog.
MAN_RELEASE = Waits for manual release.
KEEP_STARTTYPE = Keeps the start type.
ONLY_ABENDED = Only repeats the subordinated tasks that were canceled.

You can specify several flags that must be separated by commas. The whole term must be written in inverted commas if these flags are named and no script variables are used.

The allowed values refer to the options that are also available for manual restarts in the dialog "Execute...".

Queue

Specification of a particular Queue object that should be used for restarting the task.

The task automatically starts in the Client Queue (CLIENT_QUEUE) if no queue has been specified.


Return code

"0" - Task restart was successful.
"20628" - The object does not exist.
"7014" - The reference RunID does not exist.
"20346" - The restart point does not exist. 
"20380" - The script element :EXIT has ended script processing in the restarted execution.
"20385" - The object is a Schedule.
"7015" - Restarting a restarted execution is not allowed.

Comments

This script function can be used to restart tasks that have already been executed.

A task can also repeat itself if this script function is called in Post Process. Note that this can result in an infinite loop.

Note that choosing one of the four test options as Flags ("GEN_JCL", "ORIGINAL_SCRIPT", "VAR_MOD" or "ATT_MOD") results in the job being aborted with :STOP. This is because the default value "N" (=No) is used as answer for the question "Do you want to start this job?".

To execute a restart with one or all of the four test options as flags successfully, please use the UserInterface, as described in Executing Options.

The RunID of the task that should be re-executed is assigned to this script function with the parameter Reference RunID. The key word LAST can also be used in order to restart a task's latest execution.

You can also specify a restart point that should be considered when the task is re-executed. The task starts but it is processed from the specified restart point. Flags are also optional and affect the task's execution.

The script statement :ON_ERROR can be used to determine the reaction to errors. They can then be analyzed using the script functions for error handling. Script processing continues but can also be canceled if necessary.

This script statement has the effect that all the script's open transactions are written to the AE database.

Examples

The following example repeats a job's the last execution. The generated JCL and the modification of variables are output in an activation log. The job waits in the Activity Window until it is manually released.

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

See also:

Script element Description
:GENERATE

Controls the processing of script lines during the execution of a script.

:ON_ERROR

Determines the reaction to certain errors and messages of script elements.

:RESTART

Sets restart points in an executable object.

SYS_ACT_RESTART

Retrieves whether the object has been activated in restart mode.

SYS_ACT_RESTART_ME_NR

Returns the run number (RunID) of an object that has been activated in restart mode.

SYS_LAST_RESTART_POINT

Supplies the name of the previous restart point in the script.

SYS_LAST_RESTART_TEXT

Supplies the text of the previous restart point as defined in the script.

SYS_RESTART_POINT

Supplies the restart point from which the object is executed.

Script Elements - Activate Objects

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function