I have explained in this post CICS reserved words EIBCALEN and DFHCOMMAREA for project reference. 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.
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 Logic in Submodule?
IF EIBCALEN > 0
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.
You can use DFHCOMMAREA in the Linkage-section to get data from the main program into the subprogram. In the main program, we pass data as below:
LINK PROGRAM (ABCDEF)
LENGTH(LENGTH OF WS-DATA-AREA)
In the sub-program, we need to use DFHCOMMAREA in the linkage section to get the data.
DFHCOMMAREA Logic in Subprogram
10 LS-DATA-AREA PIC X(1000)
These are two possible methods to get data in the Submodule from the main program. I have collected the picture from IBM, how data will pass check here.