How to write Menu Driven CICS programs

You can develop CICS programs, especially menus in the way mentioned below. Any menu driven program should have 3 layers of logic:

  • Presentation Logic ==> 3270 Terminals
  • Business Logic ==> COBOL programs
  • Data Logic ==> Data bases IMS DB/DB2

3 Commands that you need for CICS Menu programs logic

  • EXEC CICS Send command to send data to 3270 terminal
  • EXEC CICS Receive command to receive data from 3270 terminal
  • EXEC CICS Return command to exit from CICS program

The communication can happen in CICS through DFHCOMMAREA and CHANNEL

Link and XCTL to call sub programs

  • EXEC CICS LINK (CICS to CICS, can be remote)
  • EXEC CICS XCTL (CICS to CICS)

Related: List of Menu Navigation Commands in CICS

Sample Logic how to handle Menus:

PROCEDURE DIVISION
 EVALUATE TRUE
        WHEN EIBCALEN = 0
                Send Initial MAP
        WHEN EIBAID = DFHENTER
                Process Screen Data
       WHEN EIBAID = DFHPF3 or DFHPF12
                 Exit Program
      WHEN OTHER
             Invalid key
 END-EVALUATE
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.