OPENAPI Support

CICS® extends the use of Open Transaction Environment (OTE) functionality by providing support for OPENAPI application programs. Prior to this, OPENAPI function was available only to task related user exits (TRUEs).

OPENAPI support allows an application not only to define itself as threadsafe, (meaning it is capable of running on any TCB that CICS deems suitable, either the QR TCB, or an open TCB) but more than that, namely that the application must run on an OPEN TCB rather than on the QR TCB.

The use of OPENAPI programs allows application workloads to be moved off the QR TCB onto multiple open TCBs. If you choose to use OPENAPI programs as a way of running workloads using other (non CICS) APIs remember that the use of other (non CICS) APIs within CICS is entirely at the discretion and risk of the user. No testing of other (non CICS) APIs within CICS has been undertaken and use of such APIs is not supported by IBM® Service.

In either case you must also be aware that OPENAPI programs still have obligations to the CICS system as a whole. See "Obligations of OPENAPI programs" in the CICS Application Programming Guide.

A new keyword (API) on the PROGRAM resource definition which takes one of two values CICSAPI or OPENAPI, where CICSAPI is the default. A setting of API(OPENAPI) mandates a setting of CONCURRENCY(THREADSAFE) meaning the application must be coded to threadsafe standards so its application logic is capable of executing with integrity when executed in parallel on multiple TCBs. CICS will handle the threadsafety aspects of any CICS APIs issued from such programs. The new program option applies to user application programs, PLT programs, user replaceable modules and task related user exits. It is ignored for global user exits.

The difference between a CICSAPI QUASIRENT program, a CICSAPI THREADSAFE program and an OPENAPI THREADSAFE program is explained in terms of where it runs:

Use of OPENAPI programs can cause more TCB switching than threadsafe CICSAPI programs because of the requirement for the key of the TCB to be correct for OPENAPI programs, because non-threadsafe CICS calls cause a double TCB switch, and because OPENAPI TRUEs always run in CICS key on an L8 TCB. Therefore, for example, a user key OPENAPI program runs on an L9 TCB but if it makes a DB2 call, CICS switches to an L8 TCB to call DB2, then returns to the L9 for the application.

It is highly recommended that existing user key threadsafe CICS-DB2 applications, which have taken advantage of the performance gains of being able to run on the same TCB as the DB2 call, remain defined as CICSAPI THREADSAFE applications. If other functionality is wanted which requires OPENAPI, a separate program should be used.

Candidate programs for defining as OPENAPI THREADSAFE (assuming their application logic is threadsafe) include: