CICS EIBCALEN and DFHCOMMAREA

Here you will know CICS reserved words EIBCALEN and DFHCOMMAREA. If the value in EIBCALEN >0, it means data present, and 0 means data not present. The full name of EIBCALEN is called EIB communication area length.

What is EIBCALEN

  • EIBCALEN is CICS reserved word. The purpose is to know if the data received or not in the submodule.
  • You call a submodule with passing data from the main program. And submodule wants to know if the data received or not. In this scenario, the submodule will use EIBCALEN to get the status.
  • Let me explain with a real-time example that I send data from a CICS screen to the main module and then to a sub-module, then you can check the EIBCALEN, if the data is received or not.

How to use EIBCALEN in Sub-module

EVALUATE TRUE

     IF EIBCALEN > 0

           EXEC CICS

           RECEIVE

           INTO(WS-RECORD)

           END-EXEC

     END-IF

END-EVALUATE.

The above sample code shows how we receive the data in the sub-module. And, you can write the code to throw ABEND when EIBCALEN = 0.

What is DFHCOMMAREA

You can use DFHCOMMAREA to get data from the main program into the subprogram in the Linkage-section. In the main program, you can pass data as below:

EXEC CICS

LINK PROGRAM (ABCDEF)

COMMAREA(WS-DATA-AREA)

LENGTH(LENGTH OF WS-DATA-AREA)

END-EXEC

In the sub-program, we need to use DFHCOMMAREA in the linkage section to get the data.

DFHCOMMAREA Logic in Subprogram

LINKAGE SECTION.

  01 DFHCOMMAREA.

       10 LS-DATA-AREA PIC X(1000)

Here are two possible methods to get data in the Submodule from the main program. Here is the flow from IBM, how data will pass check here.  

Keep Reading


Author: Srini

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