Avoiding affinities when using the RETRIEVE WAIT and START commands

The use of some synchronization techniques permit the sharing of task-lifetime storage between two synchronized tasks. Use the RETRIEVE WAIT and START commands for this purpose.

In the example illustrated in Figure 1 , TRN1 is designed to retrieve data from an asynchronous task, TRN2, and therefore must wait until TRN2 makes the data available. Note that for this mechanism to work, TRN1 must be a terminal-related transaction.

The steps are as follows:
  1. TRN1 writes data to a TS queue, containing its TRANSID and TERMID.
  2. To cause itself to suspend, TRN1 issues a RETRIEVE WAIT command, which causes CICS to suspend the task until the RETRIEVE can be satisfied, which is not until TRN2 issues a START command with data passed by the FROM parameter.
  3. However, TRN2 can only issue a START command to resume TRN1 if it knows the TRANSID and TERMID of the suspended task (TRN1 in our example). Thus it reads the TS queue to obtain the information written by TRN1. Using a temporary storage queue is one way that this information can be passed by the suspending task.
  4. Using the information from the TS queue, TRN2 issues the START command for TRN1, causing CICS to resume TRN1 by satisfying the outstanding RETRIEVE WAIT.
Figure 1. Illustration of task synchronization using RETRIEVE WAIT and START commands
TRN1 executes in AOR1 and stores its TRANSID and TERMID in a TS queue for TRN2 then suspends by issuing a RETRIEVE WAIT. TRN2 executes in AOR1, reads the TRANSID and TERMID and resumes TRN1 by issuing START with FROM.
In the example of task synchronization using RETRIEVE WAIT and START commands shown in Figure 1 , the START command that satisfies the RETRIEVE WAIT must:
  • Be issued in same target region as the transaction (TRN1 in our example) issuing the RETRIEVE WAIT command, or
  • Specify the SYSID of the target region where the RETRIEVE WAIT command was executed, or
  • Specify a TRANSID (TRN1 in our example) that is defined as a remote transaction residing on the target region that executed the RETRIEVE WAIT command.

An application design based on the remote TRANSID technique only works for two target regions. An application design using the SYSID option on the START command only works for multiple target regions if all target regions have connections to all other target regions (which may not be desirable). In either case, the application programs must be modified: there is no acceptable way to use this programming technique in a dynamic or distributed routing program except by imposing restrictions on the routing program. In general, this means that the dynamic or distributed routing program must ensure that TRN2 must execute in the same region as TRN1 to preserve the application design.



dfhp3t8.html | Timestamp icon Last updated: Monday, 5 June 2017