# Scenarios of CICS DB2 Transaction Definition

Three DB2 transaction definition scenarios are described as follows:

- The user DB2 program does not need a CICS DB2Tran definition and can run under the transaction ID `SXEX` or Mirror Tran.

  Define the recipe in Substation ES as you would any other CICS program.

- The user DB2 program needs a CICS DB2Tran definition or cannot run under transaction ID `SXEX` or Mirror Tran, and does not need to be routed.

  Do the following items for the CICS environment:

  - Define the user DB2 program to CICS that uses COMMAREA, Container, or TSQ for input and output.
  - Define the transaction ID to run the program for `DB2Entry` matching, if necessary.
  - Define `DB2Entry`, if necessary.
  - Define `DB2Tran`, if necessary.

  Do the following items for security:

  - Allow CSMI to link to the user DB2 program.
  - Allow `Userid` in Substation ES to run CSMI, `DFHMIRS`, and the user DB2 program.

  Determine the following definitions:

  - CSMI: determines if the following IBM default definitions are appropriate for running your program. If not, redefine and test them:

    `TASKDATALoc: Below`

    `TASKDATAKey: User`

    `DYnamic: No`

    `ROutable: No`

  - `DFHMIRS`: determines if the following IBM default definitions are appropriate for running your program. If not, redefine and test them:

    `DAtalocation: Below`

    `DYnamic: No`

  Do the following items for the Substation ES environment:

  - Define the message as you would with other recipes.
  - Define the buffer as you would with other recipes.
  - Define the conversion as you would with other recipes.
  - Define the recipe:

    Define the fields as you would with other recipes.

    Set Method of Invocation to 2 DPL, 10 Container, 11 Storage, or 12 DPL TSQ.

    Optional. If the user DB2 program must run under a transaction ID other than `SXEX`, set Mirror Tran to the transaction ID for the CICS environment.

    The user DB2 program initially starts for the transaction CSMI and the program `DFHMIRS`, which then changes the transaction ID to the value you defined as the mirror transaction. This value is for matching `DB2TRAN` entries and thus `DB2Entry` for the DB2 program. `EIBTRANID` is set to Mirror Tran so that the user DB2 program sees itself as running under the transaction ID of the Mirror Tran value.

- The user DB2 program needs a CICS DB2Tran definition. Otherwise, the program cannot run under transaction ID `SXEX` and must be routed.

  Do the following items for the CICS environment:

  - Define the user DB2 program to CICS that uses COMMAREA, Container, or TSQ for input and output in the AOR.
  - Define the transaction ID to run the program in the AOR with program name of `DFHMIRS`.
  - Define `DB2Entry` in the AOR, if necessary.
  - Define `DB2Tran` in the AOR, if necessary.
  - Define the transaction ID to run the program in the CICS that interfaces to the SOR with the program name `DFHMIRS`, using REMOTE ATTRIBUTES to define how to route the transaction to the AOR.

  Do the following items for the Substation ES environment:

  - Define the message as you would with other recipes.
  - Define the buffer as you would with other recipes.
  - Define the conversion as you would with other recipes.
- Define the recipe:
  - Define the fields as you would with other recipes.
  - Set Method of Invocation to 2 DPL, 10 Container, 11 Storage, or 12 DPL TSQ (if DPL TSQ is used), and then direct TSQ requests in AOR to SOR for the IDs that start with `SXCT`.
  - Set Mirror Tran to the transaction ID for the CICS environment.
  - Set User Tran to N.

Copyright © TIBCO Software Inc. All rights reserved.