Tuesday, 26 March 2019

CICS Transaction Flow: From TRANSID to Program Execution

A request containing the four-character transaction ID INQ1 does not call a COBOL program directly. CICS matches the identifier to an installed TRANSACTION resource, creates a task for that request, and gives control to the resource's initial program.

CICS transaction flow from a TRANSID request through resource lookup task creation and program execution
A TRANSID identifies the transaction type; each request runs as a separate CICS task.

What happens during a CICS transaction?

The exact entry channel can be a 3270 terminal, another program, an HTTP request, a message, a timer, or another CICS region. The core CICS transaction flow is similar: CICS receives a transaction request, resolves its definition, establishes an execution environment, starts a task, and invokes the first program.

Terminology: IBM uses transaction for a type of processing and sometimes for one execution of it. A task is the specific running instance. A unit of work is the recoverable set of updates committed or backed out together.

CICS transaction flow step by step

1. A request supplies the TRANSID

For a terminal request, a user might enter INQ1. A program can also schedule work with EXEC CICS START TRANSID(...). The name identifies a TRANSACTION resource; it is not necessarily the program name.

2. CICS resolves the transaction resource

The installed definition supplies the initial PROGRAM name or identifies a remote system. It can also contribute priority, profile, transaction class, security, and transaction work-area settings. A missing, disabled, or unavailable resource stops the request before application logic runs.

3. CICS creates a task

CICS creates one task for this invocation and assigns a task number. If 100 users start INQ1, the transaction definition is shared, but each invocation has its own task state. This distinction is covered further in CICS multitasking and multithreading.

4. CICS gives control to the first program

CICS resolves the installed PROGRAM resource and loads the executable code when it is not already available. The application then issues translated EXEC CICS commands for terminal, file, queue, program, or Db2 work. Additional programs can be called with LINK, XCTL, or language-level calls, subject to the application's design.

5. Work is committed or backed out

Recoverable changes belong to a unit of work. A normal end normally results in commit processing; a failure can cause backout. An explicit EXEC CICS SYNCPOINT ends the current unit of work, so a long-running task can contain several units of work.

6. CICS returns the response and ends the task

A terminal program can send a BMS map and issue RETURN. In a pseudo-conversational design, RETURN TRANSID('INQ1') ends the current task and tells CICS which transaction should handle the next input. Read conversational versus pseudo-conversational CICS for the storage and task-lifetime difference.

Transaction, task, program, and unit of work

TermMeaningINQ1 example
TransactionA defined type of CICS processing.The installed INQ1 TRANSACTION resource.
TaskOne running instance of a transaction.User A and user B receive separate task numbers.
ProgramExecutable application logic used by a task.INQPGM1 is the first program named by the resource.
Unit of workUpdates committed or backed out as one recoverable set.A file update and Db2 update before the same syncpoint.

Modern resource definitions replace PCT and PPT wording

Older training material describes a Program Control Table (PCT) and Processing Program Table (PPT). Those names belong to macro-table administration used by older CICS releases. Current CICS Transaction Server uses installed TRANSACTION and PROGRAM resource definitions. Definitions are commonly held in the CICS system definition data set (CSD), grouped, and installed with resource definition online (RDO).

CEDA DEFINE TRANSACTION(INQ1) GROUP(MYAPP) PROGRAM(INQPGM1) CEDA DEFINE PROGRAM(INQPGM1) GROUP(MYAPP) LANGUAGE(COBOL) CEDA INSTALL GROUP(MYAPP)
Operational boundary: creating a definition in the CSD does not by itself make the resource active. The required group must be installed in the target CICS region, normally under site change control.

Local execution versus transaction routing

A TRANSACTION definition can name a local program or a remote system. With transaction routing, the terminal can be owned by one CICS region while the transaction executes in another. This is different from function shipping, where an application runs locally but sends a file or queue request elsewhere.

Keep this page focused on request-to-program flow. The broader concepts remain on CICS transactions on the mainframe, while the CICS overview explains the platform's role.

How to trace a transaction that does not start

Begin with the resource state rather than changing the program immediately. Exact commands and permissions depend on the region.

CEMT INQUIRE TRANSACTION(INQ1) CEMT INQUIRE PROGRAM(INQPGM1)
  • Confirm that the TRANSACTION resource is installed and enabled.
  • Check that its PROGRAM attribute points to the intended initial program.
  • Confirm that the PROGRAM resource is installed and enabled and that the load module is in the region's program search path.
  • Review CICS messages, transaction dumps, security failures, and routing configuration before assuming a COBOL defect.
  • If a new load module was deployed, follow site procedure for a program newcopy or phase-in.

The CICS command reference provides application-command syntax. Interview preparation is kept separately in the CICS interview questions page.

Common transaction-flow mistakes

  • Calling the TRANSID a program name: the transaction definition points to the initial program; the two names can differ.
  • Treating every user as a new transaction definition: CICS creates a new task, not a new definition.
  • Equating task end with every commit: explicit syncpoints can divide one task into several units of work.
  • Using PCT and PPT as current configuration objects: use TRANSACTION and PROGRAM resource terminology for supported CICS TS administration.
  • Ignoring routing: the program might run in a different region from the terminal-owning region.

Official IBM references

Frequently asked questions

What is a CICS transaction ID?

A transaction ID, or TRANSID, is the name of a CICS TRANSACTION resource. It is normally one to four characters and identifies the transaction type that CICS is being asked to run.

What is the difference between a CICS transaction and a task?

The transaction is the defined type of work. A task is one running instance of that transaction. Ten users can start the same TRANSID and CICS can create ten separate tasks.

Does CICS still use PCT and PPT tables?

PCT and PPT are legacy terms. Current CICS Transaction Server documentation describes installed TRANSACTION and PROGRAM resource definitions, generally stored in the CSD and managed with RDO commands such as CEDA.

Is a CICS transaction the same as a unit of work?

Not always. A task can issue syncpoints, so one task can contain more than one unit of work. A unit of work is the recoverable set of changes that CICS commits or backs out together.

Practical check: when INQ1 fails before its first screen, verify the installed TRANSACTION definition, its PROGRAM attribute, the PROGRAM state, security, and routing before debugging business logic.

No comments:

Post a Comment

New In-feed ads