Using GETMAIN SHARED storage

Shared storage is allocated by a GETMAIN SHARED command, and remains allocated until explicitly freed by the same, or by a different, task.

Shared storage can be used to exchange data between any CICS tasks that run during the lifetime of the shared storage. Transactions designed in this way must execute in the same CICS region to work correctly. The dynamic or distributed routing program should ensure that transactions using shared storage are routed to the same target region.

Figure 1 illustrates the use of shared storage.
Figure 1. Illustration of inter-transaction affinity created by use of shared storage. The dynamic transaction routing program needs to be aware of this affinity, and ensure that it routes TRN2 to the same target region as TRN1.
TRN1 executes in AOR1, GETMAINS shared storage, writes data to it and stores the address in a TS queue. TRN2 reads the address from the TS queue, reads the data and FREEMAINs the storage.

If the two transactions shown in Figure 1 are parts of a pseudoconversational transaction, the use of shared storage should be replaced by a COMMAREA (if the amount of storage fits within the COMMAREA size limits).



dfhp3t2.html | Timestamp icon Last updated: Thursday, 27 June 2019