You can use CALL identifier statements to make dynamic calls in the CICS environment. However, you must set the COBPATH environment variable correctly. You also must make sure that the called module has the correct name.
Consider the following example, in which alpha is a COBOL program that contains CICS statements:
WORKING-STORAGE SECTION.
01 WS-COMMAREA PIC 9 VALUE ZERO.
77 SUBPNAME PIC X(8) VALUE SPACES
. . .
PROCEDURE DIVISION.
MOVE 'alpha' TO SUBPNAME.
CALL SUBPNAME USING DFHEIBLK, DFHCOMMAREA, WS-COMMAREA.
You must pass the CICS control blocks DFHEIBLK and DFHCOMMAREA (as shown above) to alpha.
The source for alpha is in file alpha.ccp. Use the command cicstcl to translate, compile, and link alpha.ccp. COBOL defaults to uppercase names. Therefore, unless you change this default by using the PGMNAME(MIXED) compiler option, you need to name the source file ALPHA.ccp (not alpha.ccp) to produce ALPHA.ibmcob (not alpha.ibmcob).
Suppose that the CICS region is called green. Then file ALPHA.ibmcob must be copied to /var/cics_regions/green/bin, and the AIX SMIT tool must be used to define ALPHA as a CICS program. Your installation staff must add the following line to the file /var/cics_regions/green/environment:
COBPATH=/var/cics_regions/green/bin
Then the staff must shut down the CICS green region and restart it. If you put dynamically called programs in some other directory, make sure that your installation staff adds that directory to COBPATH and that the CICS servers have permission to access that directory.
related tasks
Making dynamic calls to shared libraries under CICS
Tuning the performance of dynamic calls under CICS
related references
Compiler and runtime environment variables