CICSVAR: CICS environment variable

CICS® provides an environment variable called CICSVAR to allow the CONCURRENCY and API program attributes to be closely associated with the application program itself. You can specify this environment variable by using the Language Environment® runtime option ENVAR.

CICSVAR can be used in a CEEDOPT CSECT to set an installation default, but it is most useful when it is set in a CEEUOPT CSECT that is link-edited with an individual program, or set by a #pragma statement in the source of a C or C++ program, or set by a PLIXOPT statement in a PL/I program. For example, when a program is coded to threadsafe standards, it can be defined as such without changing a PROGRAM resource definition, or it can adhere to an installation-defined naming standard to allow a program autoinstall exit to install it with the correct attributes.

CICSVAR can be used for Language Environment-conforming assembler language, for PL/I, for COBOL, and for C and C++ programs (both those compiled with the XPLINK option, and those compiled without it), if the programs werecompiled using a Language Environment-conforming compiler. CICSVAR cannot be used for assembler language programs that are not Language Environment-conforming, or for Java™ programs.

The use of CICSVAR overrides the settings on a PROGRAM resource definition installed through the standard RDO interfaces, or through program autoinstall. Before the program is run for the first time, an INQUIRE PROGRAM command shows the keyword settings from the program definition. When the application has run once, an INQUIRE PROGRAM command shows the settings with any CICSVAR overrides applied.

Valid values for CICSVAR are QUASIRENT, THREADSAFE, REQUIRED, and OPENAPI.
CICSVAR=QUASIRENT
Results in a program with the attributes CONCURRENCY(QUASIRENT) and APIST(CICSAPI).
CICSVAR=THREADSAFE
Results in a program with the attributes CONCURRENCY(THREADSAFE) and APIST(CICSAPI).
CICSVAR=REQUIRED
Results in a program with the attributes CONCURRENCY(REQUIRED) and APIST(CICSAPI).
CICSVAR=OPENAPI
Results in a program with the attributes CONCURRENCY(REQUIRED) and APIST(OPENAPI).
The following example shows the Language Environment runtime option ENVAR coded in a CEEUOPT CSECT:
CEEUOPT CSECT        
CEEUOPT AMODE ANY    
CEEUOPT RMODE ANY    
        CEEXOPT ENVAR=('CICSVAR=THREADSAFE')   
        END
This code can be assembled and link-edited into a load module, and then the CEEUOPT load module can be link-edited together with any language program supported by Language Environment.
Alternatively, for C and C++ programs, add the following statement at the start of the program source before any other C statements:
#pragma runopts(ENVAR(CICSVAR=THREADSAFE)) 
For PL/I programs, add the following statement following the PL/I MAIN procedure statement:
DCL PLIXOPT CHAR(25) VAR STATIC EXTERNAL  INIT('ENVAR(CICSVAR=THREADSAFE)');