CICS-EIBCALEN, RECEIVE,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:  This CICS reserved word we use usually in the subroutine, say, we are calling a sub-program, and passing some data.

The interesting point is we do not know whether data is received or not (I hope you got the point. I am getting some data from the screen passing to first main program and next to sub-program). With this variable we 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, we 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 sub program.

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.