TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

CICS Program Compile Process


CICS-DB2-COBOL Program – Compilation

COBOL programs cannot recognize CICS commands. So all the CICS commands are coded within EXEC CICS and END-EXEC scope. The program is first passed to CICS Translator and the translator will convert all the CICS commands to COBOL call statements and this modified source is passed to COBOL compiler.

If your Program has DB2 commands then the sequence of preparing load module would be DB2 Pre-compiler, CICS Translator, COBOL Compiler and Link editor. Logically speaking the order of DB2 precompiler and CICS translator can be reversed also. But as a convention we are first doing precompilation.

If translation is done first, CICS translator tries to recognize to DB2 statements and would issue diagnostic messages. The other reason is, most of the programs do lot of DB2 operations than CICS operations. So if you do pre-compilation first, all the DB2 statements are converted into COBOL call statements in first phase itself and the translation time would be less.

COBOL-CICS programs should be compiled with RENT RESIDENT NODYNAM and LIB options.

CICS program compilation steps
  • Translator - Checks for syntax errors etc., in CICS commands & translate them into equivalent COBOL statements.

    1. Looks for the statements EXEC CICS …

    2. Comments out the entire EXEC CICS … END-EXEC statement

    3. Replaces the CICS statements with a set of MOVE statements and COBOL “CALL” statements and passes as parameters, the command options.

    4. Insert the Execute Interface Block copybook DFHEIBLK in the LINKAGE Section of the program.

    5. Add the DFHCOMMAREA in the linkage section with a size of 1 byte if it is not specified.

  • Compiler - Expands COBOL copy books, checks the source code for syntax errors etc., and compiles.

  • Linkage Editor - Links different object modules to create a single load module.

Note:
  • As translator doesn’t expand COBOL copy books, they should not contain any CICS commands.

  • As the module is going to be a part of CICS program, it should not contain any restricted COBOL commands.


Restricted COBOL commands in CICS environment:

  1. OS SVC Triggering statements:
    ACCEPT, CURRENT-DATE, DATE, DAY, DISPLAY

  2. Input/Output statements:
    OPEN, CLOSE, READ, WRITE, REWRITE, DELETE, START

  3. SORT statement:
    RETURN, RELEASE

VS COBOL 2 allows STOP RUN and that returns control back to CICS.


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal