Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 4: CICS COBOL Programming


CICS Translator

The COBOL compiler cannot understand EXEC CICS statements. The CICS translator is the precompile step that reads your source first, checks every CICS command, and converts it into plain COBOL that the compiler can handle.

What the translator does

  • It runs before the COBOL compiler, as the first step of the build job.
  • It checks the syntax of every EXEC CICS command and reports errors with clear messages.
  • It converts each EXEC CICS command into COBOL CALL statements to the CICS interface module.
  • It automatically generates the DFHEIBLK (EIB) layout and the DFHRESP condition names.
  • It inserts DFHEIBLK and DFHCOMMAREA definitions into the Linkage Section if they are missing.
  • Its output is pure COBOL source with no EXEC CICS statements left in it.

Translator options

  • The translator is run with the program DFHECP1$. Options are passed on its PARM.
  • COBOL3 tells the translator the source is Enterprise COBOL. (COBOL2 was for the older compiler.)
  • Use COBOL3 for all new programs so the translator matches your compiler level.
  • Other options control listings and margins, but COBOL3 is the one you will see most often.

Before and after translation

  • Before: you write a readable EXEC CICS command in your source.
  • After: the compiler sees ordinary COBOL CALL statements. You never code these calls yourself.
*-- What YOU write:
EXEC CICS SEND TEXT FROM(WS-MSG) LENGTH(20) END-EXEC.

*-- What the COMPILER sees (simplified):
CALL 'DFHEI1' USING DFHEIBLK WS-MSG ... .





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant