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 as shown in
the previous example. 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.
-
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-CONTROLentry in theENVIRONMENT DIVISIONFILE SECTIONin theDATA DIVISIONUSEdeclaratives, exceptUSE FOR DEBUGGING
The following COBOL statements are also not recommended for use in a CICS environment:
ACCEPTformat 1CLOSEDELETEDISPLAY UPON CONSOLE,DISPLAY UPON SYSPUNCHMERGEOPENREADREWRITESORTSTARTSTOPliteralWRITE
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 previous statements will not be possible.