A sample application

A simple example can be used to explain the consequences of different application design techniques.

Figure 1 shows how CICS MAPs and transaction IDs are correlated, and how the transactions work, without Db2® considerations.
Figure 1. Example of a typical application design
The application has two transactions, TRX0 and TRXA. Both work in the same way, which is explained more fully in the text following the diagram. In summary, TRX0 is activated when MAP0 is displayed. Program P0 is the initial program for the transaction. Program P0 performs a CICS transfer control (XCTL) to one of the programs P1, P2, or P3. P1 displays MAP1, P2 displays MAP2, and P3 displays MAP3. The other transaction, TRXA, is activated when MAPA is displayed. Program PA is the initial program for the transaction. Program PA performs a CICS transfer control (XCTL) to one of the programs PB, PC, or PD. PB displays MAPB, PC displays MAPC, and PD displays MAPD. The relationship between the two transactions is that program P3 in transaction TRX0 may transfer control to program PB in transaction TRXA.
In this example:
  • The transaction ID, TRX0, is specified in the EXEC CICS RETURN TRANSID(TRX0) command, when a program (not shown) returns control after displaying MAP0.
  • The next transaction then uses the transaction ID, TRX0, independent of what the terminal user decided to do.
  • Program P0 is the initial program for transaction TRX0.
  • We assume that all programs shown are issuing SQL calls.
  • Depending on the option chosen by the terminal user, program P0 performs a CICS transfer control (XCTL) to one of the programs: P1, P2, or P3.
  • After issuing some SQL calls, these programs display one of the maps: MAP1, MAP2, or MAP3.
  • The example shown on the right side of the figure works in the same way.
  • In some situations, program P3 transfers control to program PB.