statement block(1) — Commands
Digital
NAME
BLOCK - groups multiple statements in a task definition into a single unit for which you can define an exception handler
SYNOPSIS
[<label-name>:] BLOCK
[<label-name-1>:] { <statement>; } [ ... ]
END BLOCK [<label-name>]
[ EXCEPTION HANDLER IS
[ [<label-name-2>:] { <statement>; } [...] ]
END EXCEPTION HANDLER ] ;
PARAMETERS
•label-name
An internal unqualified identifier associated with the beginning of the statement block, for use in flow control operations within the task.
•label-name-1
An internal unqualified identifier associated with a statement within the statement block, for use in flow control operations within the statement block.
•label-name-2
An internal unqualified identifier associated with a statement within the exception handler, for use in flow control operations within the exception handler.
•statement
One or more statements from the STDL statement list. See the statement man page. A statement block can contain a transaction block; and statement blocks can be used within a transaction block.
DESCRIPTION
Normal execution for a statement block is to execute the statement list and complete with default flow control. If the statement list completes with EXIT BLOCK flow control, normal execution flow is not affected.
Deviations from the normal execution flow occur when the statement list completes with one of the following:
oExplicit EXIT TASK or GO TO flow control. The statement block completes with the same explicit flow control with which the statement list completed.
oAn exception and the statement block is outside a transaction block. If the exception type is one of the following, the specified completion occurs:
-Fatal transaction exception
The statement block completes with the exception.
-Transient transaction exception
If an exception handler is available, the exception handler executes. If no exception handler is applicable, the statement block completes with a permanent exception.
-Permanent transaction or nontransaction exception
If an exception handler is available, the exception handler executes. If no exception handler is applicable, the statement block completes with a permanent exception.
oAn exception and the statement block is inside a transaction block or composable task. If the exception type is one of the following, the specified completion occurs:
-Fatal, permanent transaction, or transient transaction exception
The statement block completes with that exception.
-Nontransaction
If an exception handler is available, the exception handler executes. If no exception handler is applicable, the statement block completes with that exception.
oExecution of the exception handler can complete with:
-Default flow control
The statement block completes with default flow control.
-Explicit flow control
The statement block completes with the same explicit flow control.
-Exception
The statement block completes with that exception.
RELATED INFORMATION
Syntax: exception_handler(1), goto(1), statement(1), task_definition(1), transaction_block(1)