Avoiding affinities using the DELAY and CANCEL REQID commands

The CICS DELAY command is used to suspend a task. Another task can cancel this command using the CANCEL command and specifying the REQID associated with the DELAY command.

With this CICS application programming technique, one task can resume another task that has been suspended by a DELAY command.

A DELAY request can be canceled only by a different task from the one issuing the DELAY command, and the CANCEL command must specify the REQID associated with DELAY command. Both the DELAY and CANCEL command must specify the REQID option to use this technique.

The steps involved in this technique using a temporary storage queue to pass the REQID are as follows:
  1. A task (TRN1) writes a predefined DELAY REQID to a TS queue. For example:
    EXEC CICS WRITEQ TS
         QUEUE('DELAYQUE') FROM(reqid_value)
  2. The task waits on another task by issuing a DELAY command, using the reqid_value as the REQID. For example:
    EXEC CICS DELAY
         INTERVAL(1000) REQID(reqid_value)
  3. Another task, TRN2, reads the REQID of the DELAY request from TS queue called 'DELAYQUE'.
  4. TRN2 completes its processing, and resumes TRN1 by canceling the DELAY request.

The process using a TS queue is illustrated in Figure 1.

Figure 1. Illustration of the use of the DELAY and CANCEL REQID commands
TRN1 executes in AOR1 and writes a DELAY command REQID to a TS queue for TRN2. It issues a DELAY command and suspends. TRN2 executes in AOR1 and reads the DELAY REQID then resumes TRN1 by issuing a CANCEL for the DELAY.

Another way to pass the REQID when employing this technique would be for TRN1 to start TRN2 using the START command with the FROM and TERMID options. TRN2 could then obtain the REQID with the RETRIEVE command, using the INTO option.

Using this application programming technique, the CANCEL command that cancels the DELAY request must:

An application design based on the remote TRANSID technique only works for two target regions. An application design using the SYSID option on the cancel command only works for multiple target regions if all target regions have connections to all other target regions. In either case, the application programs need to be modified: there is no acceptable way to use this programming technique in a dynamic or distributed routing environment except by imposing restrictions on the routing program.

If the CANCEL command is issued by a transaction that is initiated from a terminal, it is possible that the transaction could be dynamically routed to the wrong target region.



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