CICS Cobol Programming Restrictions


The CICS application program has a basic structure, and should adhere to standard programming language rules. In CICS programs, most processing logic is expressed through standard language statements.

COBOL programming restrictions and requirements -


There are specific restrictions and requirements for using the COBOL program in conjunction with CICS. By default, neither the CICS translator nor the COBOL compiler detects the use of COBOL words that are impacted by these restrictions. Using a restricted word in a COBOL + CICS program can lead to execution failures in CICS environment.

Below are the list of rules that needs to satisfied at the DIVISION level.

The IDENTIFICATION DIVISION should satisfy the below restrictions -

  • IDENTIFICATION DIVISION header is mandatory.
  • PROGRAM-ID is mandatory.
  • Other entries are optional but recommended.

The ENVIRONMENT DIVISON should satisfy the below restrictions -

  • ENVIRONMENT DIVISION header is mandatory.
  • Other entries are optional and not needed.

The DATA DIVISION should satisfy the below restrictions -

  • DATA DIVISION header entry is mandatory.
  • FILE SECTION is not required.
  • WORKING-STORAGE SECTION is needed. The length of working storage should not exceed 64k.
  • LINKAGE SECTION is optional. However, it is mandatory when communicating with other programs in the CICS region.

The PROCEDURE DIVISION should satisfy the below restrictions -

  • PROCEDURE DIVISION header entry is mandatory.
  • Entry points can't be used in the CICS application program.
  • Any COBOL file commands for OPEN, CLOSE, READ, START, REWRITE, WRITE, or DELETE statements. Instead, use CICS commands to retrieve, update, insert, and delete data.
  • Do not use the ACCEPT statement in a CICS program.
  • Do not use DISPLAY...UPON CONSOLE and DISPLAY...UPON SYSPUNCH. DISPLAY to the system logical output device (SYSOUT, SYSLIST, SYSLST) is supported.
  • Do not use STOP "literal". STOP RUN is allowed.
  • There are restrictions on the use of the SORT statement. Do not use MERGE.
  • Do not use USE declaratives.
  • Do not use user-specified parameters in the main program.

Other Coding requirements -


  • When using a debugging line as a comment, ensure that it does not contain any unmatched quotation marks.
  • Statements to produce variable-length areas such as OCCURS DEPENDING ON should be used cautiously within the WORKING-STORAGE SECTION.
  • Avoid using EXEC CICS commands in a Declarative Section.
  • Code both EXEC CICS and END-EXEC statements in Area B (columns 12-71).
  • If no IDENTIFICATION DIVISION is present, only the CICS commands are expanded.
  • If the IDENTIFICATION DIVISION is present, only DFHEIVAR, DFHEIBLK, and DFHCOMMAREA are produced.
  • If the DLI option is coded and an ENTRY statement immediately follows the PROCEDURE DIVISION header in an existing program, change the PROGRAM-ID name to the ENTRY statement literal and delete the ENTRY statement before calling the program in CICS.
  • If you use HANDLE CONDITION or HANDLE AID, you can avoid addressing problems by using SET(ADDRESS OF LK-DATA) or SET(LK-POINTER) where LK-DATA is a structure in the LINKAGE SECTION and LK-POINTER is defined with the USAGE IS POINTER clause.
Note! The integrated CICS translator does not produce an error message when an EXEC CICS statement starts in Area A because the keyword EXEC may be used in Area A as part of other statements, such as SQL statements.