Summary -

In this topic, we described about the below sections -

The CICS application program has the basic structure and it must be coded based on the set of rules of standard programming language. In CICS programs, most of the processing logic is expressed in standard language statements. In this chapter, we will discuss about COBOL as a standard programming language.

COBOL programming restrictions and requirements

There are some restrictions and requirements for COBOL program that is to be used along with CICS. By default, the CICS translator and the COBOL compiler do not detect the use of COBOL words affected by the restrictions below. The use of a restricted word in a CICS environment may cause a failure at execution time. The IDENTIFICATION DIVISION must satisfy the below restrictions.

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

The ENVIRONMENT DIVISON must satisfy the below restrictions.

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

The DATA DIVISION must satisfy the below restrictions.

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

The PROCEDURE DIVISION must satisfy the below restrictions.

  • PROCEDURE DIVISION header entry is mandatory.
  • Entry points can't be used in application program in CICS.
  • 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 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 to the main program.

Other Coding requirements

  • When a debugging line used as a comment, it must not contain any unmatched quotation marks.
  • Statements to produce variable-length areas such as OCCURS DEPENDING ON should be used with caution within the WORKING-STORAGE SECTION.v
  • Do not use EXEC CICS commands in a Declaratives Section.
  • Start 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 specified 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.
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.