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
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.
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:
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)
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.