CICS EIBCALEN and DFHCOMMAREA

Compared to IMS-DC the process for CICS is easier. In this post I would like to give some of the important topics.

EIBCALEN

CICS reserved word and you would use it in the subroutine. For example, you are calling a subprogram and passing data. The interesting point is you do not know whether data is received or not.

I pass data from the screen to first main program and to next sub-program. With this variable, you can test it and control the program-logic.

EVALUATE TRUE
     IF  EIBCALEN = 0
           EXEC  CICS
           RECEIVE  INTO(WS-RECORD)
           END-EXEC
    END-IF
END-EVALUATE

And, you can continue writing the code, If EIBCALEN = 1 to throw abend.

The above sample code shows how we receive the data in sub-module.

Similarly, we can use DFHCOMMAREA in Linkage section, to get data from the main program into subprogram.

In the main program, we 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 linkage section to get the data.

Sub-program:

LINKAGE SECTION.
  01 DFHCOMMAREA.
       10 LS-DATA-AREA  PIC X(1000)

The above are the possible ways to get data from main-program to sub-program. I have collected the picture  from IBM, how data will pass check here .  


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.