exit block(1) — Commands
Digital
NAME
EXIT BLOCK − statement in a task definition that ends the current block
SYNOPSIS
[<label-name>:] EXIT BLOCK [ WITH { COMMIT | ROLLBACK } TRANSACTION ] ;
PARAMETER
•label-name
An internal unqualified identifier associated with the statement, for use in flow control operations.
DESCRIPTION
If the block to be exited is a transaction block, you can specify the TRANSACTION control option. ROLLBACK explicitly rolls back the current transaction. If you specify ROLLBACK, any transactional resources modified by tasks participating in the transaction are rolled back.
COMMIT explicitly commits the current transaction. If you specify COMMIT, any transactional resources modified by tasks participating in the transaction are committed as part of the same transaction. Use an explicit COMMIT or ROLLBACK only at the demarcation point of a transaction. (COMMIT is the default if the block being left is a transaction block.)
An EXIT BLOCK:
oPerforms ROLLBACK TRANSACTION or COMMIT TRANSACTION, if specified. If ROLLBACK TRANSACTION or COMMIT TRANSACTION can be specified but are not, EXIT BLOCK performs the default (commit).
oCompletes with explicit EXIT BLOCK flow control. Control passes to the next statement in the task definition after the end of the current block.
If an exception occurs, EXIT BLOCK completes with that exception.
EXCEPTIONS
The EXIT BLOCK statement can generate the TXN-FAILURE-ERROR exception class.
The TXN-FAILURE-ERROR exception class indicates one of the following error conditions:
oOne of the resource managers participating in the transaction was unable to commit the transaction.
oOne of the resource managers participating in the transaction failed to acknowledge a message when attempting to commit the transaction.
RELATED INFORMATION
Syntax: block(1), statement(1), task_definition(1)