Transaction management systems on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


How a CICS transaction flows

Transaction management systems on z/OS

While it runs, your application program requests various CICS® facilities to handle message transmissions between it and the terminal, and to handle any necessary file or database accesses.

To begin an online session with CICS, users usually begin by "signing on," the process which identifies them to CICS. Signing on to CICS gives users the authority to invoke certain transactions. When signed on, users invoke the particular transaction they intend to use. A CICS transaction is usually identified by a 1- to 4-character transaction identifier or TRANSID, which is defined in a table that names the initial program to be used for processing the transaction.

Application programs are stored in a library on a direct access storage device (DASD) attached to the processor. They can be loaded when the system is started, or simply loaded as required. If a program is in storage and isn't being used, CICS can release the space for other purposes. When the program is next needed, CICS loads a fresh copy of it from the library.

In the time it takes to process one transaction, the system may receive messages from several terminals. For each message, CICS loads the application program (if it isn't already loaded), and starts a task to execute it. Thus, multiple CICS tasks can be running concurrently.

Multithreading is a technique that allows a single copy of an application program to be processed by several transactions concurrently. For example, one transaction may begin to execute an application program (a traveller requests information). While this happens, another transaction may then execute the same copy of the application program (another traveller requests information). Compare this with single-threading, which is the execution of a program to completion: processing of the program by one transaction is completed before another transaction can use it. Multithreading requires that all CICS application programs be quasi-reentrant; that is, they must be serially reusable between entry and exit points. CICS application programs using the CICS commands obey this rule automatically.

CICS maintains a separate thread of control for each task. When, for example, one task is waiting to read a disk file, or to get a response from a terminal, CICS is able to give control to another task. Tasks are managed by the CICS task control program.

CICS manages both multitasking and requests from the tasks themselves for services (of the operating system or of CICS itself). This allows CICS processing to continue while a task is waiting for the operating system to complete a request on its behalf. Each transaction that is being managed by CICS is given control of the processor when that transaction has the highest priority of those that are ready to run.

While it runs, your application program requests various CICS facilities to handle message transmissions between it and the terminal, and to handle any necessary file or database accesses. When the application is complete, CICS returns the terminal to a standby state. Figure 1, Figure 2, and Figure 3 help you understand what goes on.

Figure 1. CICS transaction flow (part 1)CICS transaction flow (part 1)
The flow of control during a transaction (code ABCD) is shown by the sequence of numbers 1 to 8. (We're only using this transaction to show some of the stages than can be involved.) The meanings of the eight stages are as follows:
  1. Terminal control accepts characters ABCD, typed at the terminal, and puts them in working storage.
  2. System services interpret the transaction code ABCD as a call for an application program called ABCD00. If the terminal operator has authority to invoke this program, it is either found already in storage or loaded into storage.
  3. Modules are brought from the program library into working storage.
    Figure 2. CICS transaction flow (part 2)CICS transaction flow (part 2)
  4. A task is created. Program ABCD00 is given control on its behalf.
  5. ABCD00 invokes Basic mapping support (BMS) and terminal control to send a menu to the terminal, allowing the user to specify precisely what information is needed.
    Figure 3. CICS transaction flow (part 3)CICS transaction flow (part 3)
  6. BMS and terminal control also handle the user's next input, returning it to ABCD01 (the program designated by ABDC00 to handle the next response from the terminal) which then invokes file control.
  7. File control reads the appropriate file for the invocation the terminal user has requested.
  8. Finally, ABCD01 invokes BMS and terminal control to format the retrieved data and present it on the terminal.




Copyright IBM Corporation 1990, 2010