How CICS shared memory works?

1.4k views Asked by At

I use EXEC CICS program control commands, LINK, XCTL, and RETURN in order to pass data between Cobol programm. The CICS shared memory get corrupted during one of my treatment. It seems that passed COMMAREA overwrite memory that not belong to CICS. To find why this problem occured I need to know better how CICS manage the shared memory when I use EXEC CICS program control commands. Does it copy COMMAREA or use pointer? Using nested EXEC CICS, how many COMMAREA are stored in the shared memory?

Configuration : I use Microfocus Net Express compiler and the environnement is UniKix.

PS : Check this question What can cause CICS transaction to write out of CICS allocated memory? if you know more about overwritting using EXEC CICS.

1

There are 1 answers

2
Bruce Martin On BEST ANSWER

Not sure about Net Express, but in CICS the commarea is accessed using a pointer.

So if program x LINKS to program y, any updates done to the commarea in y will be visible in x.

I gets worse if the Commarea definition in y is bigger than the definition in x - you could update variables after the commarea.

For XCTL, the commarea would be copied into a CICS control area and a pointer passed to the program