Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-19
BEGIN-TRANSACTION Statement
imperative-statement
is the statement to be executed if an error occurs or the transaction is being restarted.
If the ON ERROR phrase is omitted and the number of restarts equals the
transaction restart limit, the terminal is suspended, but can be restarted.
If the transaction fails for any reason while the terminal is in transaction mode, TMF
backs out any updates performed on the data base for the current transaction. If the
transaction was not terminated deliberately by execution of the ABORT-
TRANSACTION statement, terminal execution is restarted at the BEGIN-
TRANSACTION statement under these conditions:
•
ON ERROR phrase is specified
•
ON ERROR phrase is not specified, but the number of restarts has not exceeded the
transaction restart limit. The maximum number of times a logical transaction can be
automatically restarted is specified with the MAXTMFRESTARTS parameter of the
PATHCOM SET PATHWAY command.
On a transaction restart, TMF assigns a new transaction-ID number to the terminal; the
TCP marks the screen for screen recovery and increments by 1 the special register
RESTART-COUNTER. The special register TERMINATION-STATUS remains at 1
(which indicates that a transaction is started or restarted). Working-storage items are
restored to the values at execution of BEGIN-TRANSACTION. If the ON ERROR
phrase is specified, the imperative statement is executed.
If the terminal is in transaction mode when the BEGIN-TRANSACTION statement is
executed, the current transaction is backed out and the terminal is suspended for a
pending abort. Terminal execution cannot be resumed.
The special register TERMINATION-STATUS is set by the BEGIN-TRANSACTION
statement to indicate the result of execution. Table 6-2
lists the possible values of
TERMINATION-STATUS.
Table 6-2. BEGIN-TRANSACTION Statement Errors
TERMINATION-
STATUS Meaning
1 The transaction is started or restarted.
2 TMF is not installed. Action without the ON ERROR phrase: the
terminal is suspended for pending abort.
3 TMF is not running. Action without the ON ERROR phrase: the
terminal is suspended, but can be restarted.
4 A fatal error was encountered while attempting to start the transaction.
Action without the ON ERROR phrase: the terminal is suspended for
pending abort.