ATMI COBOL Function Reference
TXINFORM()
- return global transaction information
DATA DIVISION.
* Include TX definitions.
01TX-RETURN-STATUS
.
COPY TXSTATUS.
01TX-INFO-AREA
.
COPY TXINFDEF.
PROCEDURE DIVISION.
CALL "TXINFORM" USINGTX-INFO-AREA, TX-RETURN-STATUS
.
TXINFORM()
returns global transaction information in TX-INFO-AREA
. In addition, this function returns a value indicating whether the caller is currently in transaction mode or not.
TXINFORM()
populates the TX-INFO-AREA
record with global transaction information. The contents of the TX-INFO-AREA
record are described under INTRO()
.
If TXINFORM
is called in transaction mode, then TX-IN-TRAN
is set, XID-REC
will be populated with a current transaction branch identifier and TRANSACTION-STATE
will contain the state of the current transaction. If the caller is not in transaction mode, TX-NOT-IN-TRAN
is set and XID-REC
will be populated with the NULL XID (see TXINTRO
for details). In addition, regardless of whether the caller is in transaction mode, COMMIT-RETURN,
TRANSACTION-CONTROL,
and TRANSACTION-TIMEOUT
contain the current settings of the commit_return
and transaction_control
characteristics, and the transaction timeout value in seconds.
The transaction timeout value returned reflects the setting that will be used when the next transaction is started. Thus, it may not reflect the timeout value for the caller's current global transaction since calls made to TXSETTIMEOUT()
after the current transaction was begun may have changed its value.
TX-RETURN-STATUS
is the record used to return a value.
Upon successful completion, TXINFORM()
returns TX-OK
, a non-negative return value.
Under the following conditions, TXINFORM()
fails and returns one of these negative values:
The function was called in an improper context (for example, the caller has not yet called TXOPEN()
).
TXOPEN(3cbl)
, TXSETCOMMITRET(3cbl)
, TXSETTIMEOUT(3cbl)
, TXSETTRANCTL(3cbl)
Within the same global transaction, subsequent calls to TXINFORM
are guaranteed to provide an XID with the same gtrid
component, but not necessarily the same bqual
component.