Open transaction environment
This chapter introduces the open transaction environment and provides a reference for the task control block (TCB) modes that are used when an application is dispatched within CICS.
This chapter includes the following topics:
4.1 Introduction to the open transaction environment
The open transaction environment (OTE) is an environment where threadsafe application code can run on its own TCB inside the CICS address space without interference from other transactions. Applications that use the OTE can run on a class of TCB called an open TCB, or on the quasi-reentrant TCB (QR TCB).
The use of an open TCB provides the following advantages over the use of the QR TCB:
No dispatching of other CICS tasks occurs on an open TCB.
Multiple open TCBs can run concurrently.
An application that runs under an open TCB can issue non CICS API requests that can involve the TCB being blocked. If blocking occurs, only this open TCB is halted, and not the whole of CICS.
When the CICS task ends, the open TCB can be reused by another CICS task.
CICS manages open TCBs in separate pools, with each pool containing a different type (or mode) of open TCB. When applications are dispatched onto a TCB, the type of TCB depends on the combination of several CICS and resource configuration parameters:
The storage protection setting for the CICS region
Whether the application executes in a JVM server
The parameters that are used during the compilation and binding process of the application
The value of the following PROGRAM resource attributes:
 – API
 – CONCURRENCY
 – EXECKEY
For more information about the open transaction environment, see the “Threadsafe learning path” topic in the IBM Knowledge Center at this website:
4.2 TCB modes
CICS manages open TCBs in separate pools, with each pool containing a different type (or mode) of open TCB. Each mode has a two-character identifier to indicate its specific purpose, and is handled by CICS in a different way. The following open TCB modes are used by CICS when running user applications:
L8 and L9 mode TCBs
These TCBs are used to run threadsafe programs; that is, programs that are defined as CONCURRENCY(THREADSAFE) or CONCURRENCY(REQUIRED) in the PROGRAM resource definition. Consider the following points:
 – L8 mode TCBs are used by CONCURRENCY(THREADSAFE) and CONCURRENCY(REQUIRED) application programs that specify API(CICSAPI) because CICS services do not require TCB key matching.
L8 mode TCBs are used for application programs that specify API(OPENAPI) with EXECKEY(CICSKEY).
 – L9 mode TCBs are used for application programs that specify API(OPENAPI) with EXECKEY(USERKEY).
T8 mode TCBs
These TCBs are used to run Java programs in a JVMSERVER resource.
X8 and X9 mode TCBs
These TCBs are used to run C and C++ programs compiled with the XPLINK option. Consider the following points:
 – X8 mode TCBs are used for XPLink application programs that specify EXECKEY(CICSKEY).
 – X9 mode TCBs are used for XPLink application programs that specify EXECKEY(USERKEY).
4.3 Changing TCB modes
A CICS task is not restricted to execution on a single TCB. During the lifetime of a task, the CICS dispatcher can perform multiple TCB change mode operations to provide the user application with the correct environment.
Although the change mode operation is not apparent to the user application at run time, it incurs a small performance penalty. A change mode operation has a path length of approximately 3,000 instructions, which equates to a small CPU overhead. The application can also be suspended if a suitable TCB is not available immediately. An excessive number of change mode operations can result in poor application performance. Minimizing TCB change modes can reduce the CPU used by an application, while improving throughput.
The remainder of this section provides a reference to the type of TCB that is used when executing application code and the required change mode operations based on the combination of CICS region and resource parameter values. The following categories of applications are described:
Java programs
Programs specifying JVM(NO) and API(CICSAPI)
Programs specifying JVM(NO) and API(OPENAPI)
Programs compiled with the XPLINK option
 
Note: Task termination occurs on the QR TCB. A switch from an open TCB to the QR TCB is always necessary.
4.3.1 Java programs
CICS programs that reference a Java application must specify the following attribute values on the resource definition:
JVM(YES)
EXECKEY(CICS)
CONCURRENCY(REQUIRED)
Java applications run on a T8 mode open TCB and never on the QR TCB.
 
Note: For compatibility with previous releases, CONCURRENCY(THREADSAFE) is the default value for Java programs, but the preferred option to use is CONCURRENCY(REQUIRED).
4.3.2 Programs specifying JVM(NO) and API(CICSAPI)
Where a CICS PROGRAM definition specifies the attribute values JVM(NO) and API(CICSAPI), the application was written in a non Java language and the program is restricted to the use of only the CICS permitted application programming interfaces.
If the program is defined with CONCURRENCY(QUASIRENT), it always runs on the QR TCB. If the program is defined with CONCURRENCY(THREADSAFE), it runs on whichever TCB is in use by CICS at the time that is determined as suitable. If the program is defined with CONCURRENCY(REQUIRED), it always runs on an open TCB.
Table 4-1 lists the TCB modes that are used, depending on the value of the CONCURRENCY attribute.
Table 4-1 TCB mode switch table for programs specifying JVM(NO) and API(CICSAPI)
CONCURRENCY
Initial TCB
DB2 or IBM MQ command
Non-threadsafe
CICS command
QUASIRENT
QR
QR  L8  QR
No change
THREADSAFE
QR
L8
QR
REQUIRED
L8
No change
L8  QR L8
 
Note: Executing a threadsafe CICS API command does not cause a TCB switch for any value of the CONCURRENCY attribute.
The following example uses a configuration that is listed in the last row of Table 4-1 and corresponds to a program that is defined with the attribute values:
JVM(NO)
API(CICSAPI)
CONCURRENCY(REQUIRED)
When the program is run, the following sequence of TCB modes is used:
1. The program begins execution. The program is initially dispatched on an L8 TCB.
2. The program executes a threadsafe CICS command. No TCB change mode is required.
3. The program executes a DB2 command. No TCB change mode is required.
4. The program executes a non-threadsafe CICS command, which results in the following TCB change mode processing:
a. Execution switches from an L8 TCB to the QR TCB.
b. The CICS command is started and completes.
c. Execution switches from the QR TCB back to an L8 TCB.
d. Control is returned to the user program.
5. The program completes. A TCB change mode operation occurs, switching from an L8 TCB to the QR TCB for task termination processing.
This approach to understanding Table 4-1 can be applied to Table 4-2 on page 31 and Table 4-3 on page 32.
4.3.3 Programs specifying JVM(NO) and API(OPENAPI)
Where a CICS PROGRAM definition specifies the attribute values JVM(NO) and API(OPENAPI), the application was written in a non Java language and the program is not restricted to use only the CICS application programming interfaces. To specify the OPENAPI value, your program must be coded to threadsafe standards and defined with CONCURRENCY(REQUIRED).
Note: The combination of CONCURRENCY(THREADSAFE) with API(OPENAPI) that was supported in previous releases is deprecated but is kept for compatibility, and produces the same behavior as CONCURRENCY(REQUIRED) with API(OPENAPI).
Table 4-2 lists the TCB on which a CICS program runs when various combinations of the STGPROT SIT parameter and the EXECKEY attribute of the PROGRAM resource are used.
Table 4-2 TCB mode switch table for programs specifying JVM(NO) and API(OPENAPI)
STGPROT
EXECKEY
Initial TCB
DB2 or IBM MQ
command
Non-threadsafe
CICS command

NO
CICS

L8

No change

L8 QR L8
USER

YES
CICS
L8
No change
L8 QR L8
USER
L9
L9 L8 L9
L9 QR L9
 
Note: Executing a threadsafe CICS API command does not cause a TCB switch for programs specifying OPENAPI.
 
4.3.4 Programs compiled with the XPLINK option
Programs that are compiled to use XPLink must be coded to threadsafe standards and be defined as API(OPENAPI) and CONCURRENCY(REQUIRED). The presence of the XPLink signature in a load module takes precedence over the API attribute on the PROGRAM resource definition.
 
Note: The combination of CONCURRENCY(THREADSAFE) with API(OPENAPI) that was supported in previous releases is deprecated but is kept for compatibility, and produces the same behavior as CONCURRENCY(REQUIRED) with API(OPENAPI).
Table 4-3 lists the TCB on which an XPLink program runs when various combinations of the STGPROT SIT parameter and the EXECKEY attribute of the PROGRAM resource are used.
Table 4-3 TCB mode switch table for programs that use the XPLink feature
STGPROT
EXECKEY
Initial TCB
DB2 or IBM MQ
command
Non-threadsafe
CICS command

NO
CICS

X8

X8 L8 X8

X8 QR X8
USER

YES
CICS
X8
X8 L8 X8
X8 QR X8
USER
X9
X9 L8 X9
X9 QR  X9
 
Note: Executing a threadsafe CICS API command does not cause a TCB switch for XPLink programs.
 
4.4 Understanding the affect of change mode operations
There are several tools available that can help you understand the affect of change mode operations.
4.4.1 CICS Monitoring Facility
CICS Monitoring Facility (CMF) data provides several fields that are related to the performance of applications and their interaction with the CICS dispatcher. The DSCHMDLY field in the DFHTASK group provides several change mode operations. It also provides and the total elapsed time the task was suspended awaiting redispatch following a change mode operation. For more information about the DFHTASK group, see “Performance data in group DFHTASK” in the IBM Knowledge Center at this website:
4.4.2 IBM CICS Performance Analyzer for z/OS
IBM CICS Performance Analyzer for z/OS (CICS PA) is a powerful offline reporting tool to help you tune and manage your CICS systems. By using the CMF and CICS statistics data, CICS PA provides comprehensive performance reporting and analysis capabilities. CICS PA is supplied with many sample reports. Several of these sample reports enable the analysis of TCB change mode operations. For more information about the features and use of CICS PA, see the following website:
4.4.3 IBM CICS Interdependency Analyzer for z/OS
IBM CICS Interdependency Analyzer for z/OS (CICS IBM IA®) is a dynamic discovery tool that helps you understand the relationships, dependencies, and flows of CICS applications. The CICS IA product provides threadsafe analysis tooling that enables application developers and systems programmers to optimize the execution of program code. For more information about the features and use of CICS IA, see IBM CICS Interdependency Analyzer, SG24-6458, and the following website:
4.4.4 IBM z Operational Insights
IBM z Operational Insights (zOI) open beta is a cloud-hosted service that provides insights into potential efficiency improvements for CICS environments and beyond, with a no-cost trial available. By using CMF data, zOI open beta can provide a quantifiable insight into many aspects of CICS operational efficiency, including how the reduction of TCB change modes can benefit your applications, which indicates your potential CPU and response time savings. For more information about the features and use of zOI open beta, see this website:
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset