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-CONTROLentry in theENVIRONMENT DIVISION, unless theFILE-CONTROLentry is used for aSORTstatementFILE SECTIONof theDATA DIVISION, unless theFILE SECTIONis used for aSORTstatement- User-specified parameters to the main program
USEdeclaratives (exceptUSE FOR DEBUGGING)- These COBOL language statements:
ACCEPTformat 1: data transfer (you can use format-2ACCEPTto retrieve the system date and time)CLOSEDELETEDISPLAY UPON CONSOLEDISPLAY UPON SYSPUNCHMERGEOPENREADRERUNREWRITESTARTSTOPliteralWRITE
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/ICALLstatements 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 DLIinstead of DL/ICALLstatements, 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