:EXIT

Script Statement: Terminates the processing of a script and sends a return code.

Syntax

:EXIT [Return code]

Syntax

Description/Format

Return code

Value that should be used as the return code.
Format: number, script variable or script function
Default value: "0"

You can use this script statement in order to stop the processing of a script with a specified return code. In doing so, you can react to conditions that cause the task to be canceled. For example, you can test a variable's content in a Script object and depending on the content, you can either continue or cancel the task.

If you use this script statement without a return code or with the value 0, script processing ends normally with the return code 0. The task itself continues (this means that jobs start with the generated JCL, notifications are displayed etc).

You can also define user return codes as return codes(see User Return Codes of Executable Objects). Script processing is canceled and the task ends abnormally  (ENDED_NOT_OK). If the option Generate Task at: Runtime is activated in the Attributes page of the task, you can react to this user return code within a workflow. 

Warning! :EXIT terminates script processing. Do not use this script element in Post Process pages. Use :MODIFY_STATE instead.

Example

The following example ends script processing with the return code 10.

:EXIT 10

See also: