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.
FILE-CONTROL
entry in theENVIRONMENT DIVISION
, unless theFILE-CONTROL
entry is used for aSORT
statementFILE SECTION
of theDATA DIVISION
, unless theFILE SECTION
is used for aSORT
statement- User-specified parameters to the main program
USE
declaratives (exceptUSE FOR DEBUGGING
)- These COBOL language statements:
ACCEPT
format 1: data transfer (you can use format-2ACCEPT
to retrieve the system date and time)CLOSE
DELETE
DISPLAY UPON CONSOLE
DISPLAY UPON SYSPUNCH
MERGE
OPEN
READ
RERUN
REWRITE
START
STOP
literalWRITE
If you plan to use the separate CICS translator, you must put any REPLACE
statements
that contain EXEC
commands after the PROCEDURE
DIVISION
header for the program, otherwise the commands will
not be translated.
Coding
file input and output: You must use CICS commands
for most input and output processing. Therefore, do not describe files
or code any OPEN
, CLOSE
, READ
, START
, REWRITE
, WRITE
,
or DELETE
statements. Instead, use CICS commands to retrieve, update, insert, and
delete data.
Coding a COBOL program to run above the 16 MB line: Under Enterprise COBOL, the following restrictions apply when you code a COBOL program to run above the 16 MB line:
- If you use IMS/ESA® without
DBCTL
, DL/ICALL
statements are supported only if all the data passed in the call resides below the 16 MB line. Therefore, you must specify theDATA(24)
compiler option. However, if you use IMS/ESA withDBCTL
, you can use theDATA(31)
compiler option instead and pass data that resides above the 16 MB line.If you use
EXEC DLI
instead of DL/ICALL
statements, you can specifyDATA(31)
regardless of the level of the IMS product. - If the receiving program is link-edited with
AMODE 31
, addresses that are passed must be 31 bits long, or 24 bits long with the leftmost byte set to zeros. - If the receiving program is link-edited with
AMODE 24
, addresses that are passed must be 24 bits long.
Displaying
the contents of data items: DISPLAY
to the system
logical output device (SYSOUT, SYSLIST, SYSLST) is supported under CICS. The DISPLAY
output
is written to the Language Environment® message
file (transient data queue CESE). DISPLAY . . . UPON CONSOLE
and DISPLAY
. . . UPON SYSPUNCH
, however, are not allowed. You
can specify the DISPSIGN
option to control output
formatting for DISPLAY
of signed numeric items.
Sorting under CICS
Getting the system date under CICS
Calling to or from COBOL programs
Determining the success of ECI calls
Using the separate CICS translator