Coding COBOL programs to run under CICS

To code a program to run under CICS®, code CICS commands in the PROCEDURE DIVISION by using the EXEC CICS command format.

About this task


EXEC CICS command-name command-options
END-EXEC

CICS commands have the basic format shown above. Within EXEC commands, use the space as a word separator; do not use a comma or a semicolon. Do not code COBOL statements within EXEC CICS commands.

In general, the COBOL language is supported in a CICS environment. However, there are restrictions and considerations that you should be aware of when you code COBOL programs to run under TXSeries® or CICS TX.
Note: Effective 9 August 2024, IBM withdraws from marketing IBM CICS TX Standard (5900-ALU) and IBM CICS TX Advanced (5737-K69).
Restrictions:
  • Db2® files that will interoperate with TXSeries or CICS TX must be created with FILEMODE(SMALL) in effect.
  • Object-oriented programming and interoperability with Java™ are not supported.
  • The source program must not contain any nested programs.
  • COBOL programs that will run under TXSeries or CICS TX must be 32 bit.

Do not use EXEC, CICS, or END-EXEC as variable names, and do not use user-specified parameters to the main program. In addition, it is recommended that you not use any of the following COBOL language elements:

  • FILE-CONTROL entry in the ENVIRONMENT DIVISION
  • FILE SECTION in the DATA DIVISION
  • USE declaratives, except USE FOR DEBUGGING

The following COBOL statements are also not recommended for use in a CICS environment:

  • ACCEPT format 1
  • CLOSE
  • DELETE
  • DISPLAY UPON CONSOLE, DISPLAY UPON SYSPUNCH
  • MERGE
  • OPEN
  • READ
  • REWRITE
  • SORT
  • START
  • STOP literal
  • WRITE

Apart from some forms of the ACCEPT statement, mainframe CICS does not support any of the COBOL language elements in the preceding list. If you use any of those elements, be aware of the following limitations:

  • The program is not completely portable to the mainframe CICS environment.
  • In the case of a CICS failure, a backout (restoring the resources that are associated with the failed task) for resources that were updated by using the above statements will not be possible.
Restriction: There is no IBM Z® host data format support for COBOL programs that are translated by the separate or integrated CICS translator and run on TXSeries or CICS TX.

Related references  
Db2 file system  
ADDR
  
IBM Z host data format considerations