TXINTRO - COBOL data structures

Description

Overview

There is syntactic description in COBOL for each call of the TX interface.

Each call is described by the following items:

Data Structures Used by the COBOL TX Interface

Two COBOL records: TX-RETURN-STATUS and TX-INFO-AREA are commonly used by the TX calls. They are expected to be defined in the Working-Storage Section by specification of COPY statements.

<<These two records are stored in the $DCDIR/include/COBOL. When compiling the UAP, it is necessary to designate this directory as the location of the COPY file. For details about the specifications needed for compilation, see a manual for the COBOL language version you are using.>>

TX-RETURN-STATUS

Every function described in this chapter takes an instance of this record as a parameter. It is used to return a value to the caller. This record is expected to be used in the context:

<<Since the value TXSTATUS of TX-RETURN-STATUS cannot be referenced by each call because FILTER is given as the data name. Redefine TX-RETURN-STATUS to have a different name so that each call can make reference using this new name. For details, see 6.4 Coding samples for X/Open-compliant UAPs.>>

01 TX-RETURN-STATUS.
  COPY TXSTATUS.

TXSTATUS is a COBOL text library defining a signed integer that may be assigned one of the following values:

 05  FILLER PIC S9(9) COMP-5.
     88 TX-NOT-SUPPORTED      VALUE 1.
*        Normal execution
     88 TX-OK                 VALUE 0.
*        Normal execution
     88 TX-OUTSIDE            VALUE -1.
*        Application is in an RM local transaction
     88 TX-ROLLBACK           VALUE -2.
*        Transaction was rolled back
     88 TX-MIXED              VALUE -3.
*        Transaction was partially committed and partially *
rolled back
     88 TX-HAZARD             VALUE -4.
*        Transaction may have been partially committed and
*        partially rolled back
     88 TX-PROTOCOL-ERROR     VALUE -5.
*        Routine invoked in an improper context
     88 TX-ERROR              VALUE -6.
*        Transient error
     88 TX-FAIL               VALUE -7.
*        Fatal error
     88 TX-EINVAL             VALUE -8.
*        Invalid arguments were given
     88 TX-COMMITTED          VALUE -9.
*        The transaction was heuristically committed
     88 TX-NO-BEGIN           VALUE -100.
*        Transaction committed plus new transaction could *
not be started
     88 TX-ROLLBACK-NO-BEGIN  VALUE -102.
*        Transaction rollback plus new transaction could
*        not be started
     88 TX-MIXED-NO-BEGIN     VALUE -103.
*        Mixed plus new transaction could not be started
     88 TX-HAZARD-NO-BEGIN    VALUE -104.
*        Hazard plus new transaction could not be started
     88 TX-COMMITTED-NO-BEGIN VALUE -109.
*        Heuristically committed plus transaction could
*        not be started

TX-INFO-AREA

This record defines a data structure where the result of the TXINFORM call is stored.

It is expected to be used in the context:

01 TX-INFO-AREA.
  COPY TXINFDEF.

TXINFDEF is a COBOL text library defining a record as follows:

*  XID record
  05 XID_REC.
     10 FORMAT-ID   PIC S9(9) COMP-5.
*  A value of -1 in FORMAT-ID means that the XID is null
     10 GTRID-LENGTH   PIC S9(9) COMP-5.
     10 BRANCH-LENGTH  PIC S9(9) COMP-5.
     10 XID-DATA   PIC X(128).
*  Transaction mode settings
  05 TRANSACTION-MODE  PIC S9(9) COMP-5.
     88 TX-NOT-IN-TRAN     VALUE 0.
     88 TX-IN-TRAN     VALUE 1.
*  Commit_return settings
  05  COMMIT-RETURN    PIC S9(9) COMP-5.
    88 TX-COMMIT-COMPLETED  VALUE 0.
    88 TX-COMMIT-DECISION-LOGGED  VALUE 1.
*  Transaction_control settings
  05  TRANSACTION-CONTROL  PIC S9(9) COMP-5.
    88 TX-UNCHAINED      VALUE 0.
    88 TX-CHAINED      VALUE 1.
*  Transaction_timeout value
  05  TRANSACTION-TIMEOUT  PIC S9(9) COMP-5.
    88 NO-TIMEOUT  VALUE 0.
*  Transaction_state information
  05  TRANSACTION-STATE  PIC S9(9) COMP-5.
    88 TX-ACTIVE  VALUE 0.
    88 TX-TIMEOUT-ROLLBACK-ONLY  VALUE 1.
    88 TX-ROLLBACK-ONLY  VALUE 2.