Testing for CICS

Your program can determine whether it is running in CICS® in two different ways:

iscics
If you are adapting an existing C language program or writing a new program that is designed to run outside CICS as well as under CICS, the C language iscics() function may prove useful. It returns a non-zero value if your program is currently running under CICS, or zero otherwise. This function is an extension to the C library.
DFH3QSS
Your program can call the DFH3QSS program to query the CICS environment and API capability. Start of changeLink DFH3QSS statically linked into your own application.End of change On return, register 15 addresses a result structure that consists of a half-word length (that includes itself) followed by a reserved half-word (currently zero) followed by a bit string:
Bit 0
When set to 1, this means that the caller is running in a CICS environment (on a CICS-managed TCB or one of its descendants).
Bit 1
When set to 1, this means that the CICS API is available to the caller (in the current PSW key, ASC-mode, AMODE and cross-memory environment).

The output structure remains accessible as long as the TCB under which the request was issued has not terminated and DFH3QSS itself is still present in virtual storage. Any change of execution state ( such as PSW key, ASC-mode, AMODE or cross-memory environment ) might affect the availability of the CICS API. Registers are preserved.

[[ Contents Previous Page | Next Page Index ]]