Pathway/iTS TCP and Terminal Programming Guide
Managing Transactions With the TMF Subsystem
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide—426751-001
5-6
SCREEN COBOL Verbs for the TMF Subsystem
The BEGIN-TRANSACTION statement indicates the restarting point to be used if a
failure occurs while the terminal is in transaction mode. If the transaction fails for any
reason, its database changes are backed out. Except when the SCREEN COBOL
program issues an ABORT-TRANSACTION, execution of the SCREEN COBOL
program can be restarted at that point if these conditions are met:
•
If the ON ERROR clause is omitted, the TCP compares the number of times that the
transaction has been restarted with the global transaction-restart limit specified with
the MAXTMFRESTARTS option of the SET PATHWAY command in
PATHCOM. If the number of restarts is less than that limit, the transaction is
restarted with a new transaction identifier, the RESTART-COUNTER special
register is incremented by 1, and the TERMINATION-STATUS special register
remains set to 1. If the number of restarts equals the transaction-restart limit, the
terminal is suspended but its execution can be resumed manually.
•
If ON ERROR is present and if the requester restarts the transaction, RESTART-
COUNTER is incremented by 1, TERMINATION-STATUS remains set to 1, and
the ON ERROR branch is executed. The ON ERROR branch of the SCREEN
COBOL program can then include a check to determine whether or not the
transaction should be restarted; for example, the program can compare RESTART-
COUNTER to a local restart limit established within the program.
If the terminal is already in transaction mode when BEGIN-TRANSACTION is issued,
it is suspended; in such a case the current transaction is backed out and terminal
execution cannot be resumed with a PATHCOM or SPI RESUME command.
The following code sequence accepts input data from the operator and starts a new
transaction. In the event of an error, the ON ERROR code tests the RESTART-
COUNTER to determine if the particular transaction has been restarted more than two
times. If the transaction has been started more than twice, it is aborted and the operator
is asked to enter the data again. If the transaction has not been restarted more than two
times, the TCP makes another attempt to process the transaction.
enter-data
.
.
ACCEPT screen...
BEGIN-TRANSACTION
ON ERROR PERFORM check-error.
IF abort-flag NOT = 0
GO TO enter-data.
.
.
SEND ...
END-TRANSACTION.
.
.
stop-trans.
GO TO enter-data.
.
.
check-error.
MOVE 0 TO abort-flag.
IF TERMINATION-STATUS = 1