DELAY

Delay the processing of a task.

Read syntax diagramSkip visual syntax diagram
DELAY

          .-INTERVAL(0)------------------------.   
>>-DELAY--+------------------------------------+---------------->
          +-INTERVAL(hhmmss)-------------------+   
          +-TIME(hhmmss)-----------------------+   
          |      .-------------------------.   |   
          |      V                         |   |   
          +-FOR----+-HOURS(data-value)---+-+---+   
          |        +-MINUTES(data-value)-+     |   
          |        '-SECONDS(data-value)-'     |   
          |        .-------------------------. |   
          |        V                         | |   
          '-UNTIL----+-HOURS(data-value)---+-+-'   
                     +-MINUTES(data-value)-+       
                     '-SECONDS(data-value)-'       

>--+-------------+---------------------------------------------><
   '-REQID(name)-'   

Conditions: EXPIRED, INVREQ

Note for dynamic transaction routing:  Using DELAY with REQID if later CANCELed could create inter-transaction affinities that adversely affect the use of dynamic transaction routing. See the CICS® Application Programming Guide for more information about transaction affinities.

Description

DELAY suspends the processing of the issuing task for a specified interval of time or until a specified time of day. It supersedes any previously initiated POST command for the task.

The default is INTERVAL(0), but for C the default is FOR HOURS(0) MINUTES(0) SECONDS(0).

Options

FOR
specifies the duration of the delay.
HOURS(data-value)
a fullword binary value in the range 0–99.
INTERVAL(hhmmss)
specifies, in packed decimal format, the interval of time that is to elapse from the time when the DELAY command is issued. The mm and ss are in the range 0–59. The time specified is added to the current clock time by CICS when the command is executed to calculate the expiration time.

When using the C language, you are recommended to use the FOR/UNTIL HOURS, MINUTES, and SECONDS options as C does not provide a packed decimal data type. You may use INTERVAL, but if the value specified is not an integer constant, the application is responsible for ensuring that the value passed to CICS is in packed decimal format.

MINUTES(data-value)
specifies a fullword binary value in the range 0–59, when HOURS or SECONDS are also specified, or 0–5999 when MINUTES is the only option specified.
REQID(name)
specifies a name (1–8 characters), which should be unique, to identify the DELAY request. Using this option to specify an application-defined name enables another transaction to cancel the DELAY request.

To enable other tasks to cancel unexpired DELAY requests, you must make the request identifier dynamically available. For example, storing it in a TS queue, whose name is known to other applications that may want to cancel the DELAY request, is one way you can pass a request identifier to other transactions.

SECONDS(data-value)
specifies a fullword binary value in the range 0–59, when HOURS or MINUTES are also specified, or 0–359 999 when SECONDS is the only option specified.
TIME(hhmmss)
specifies, in packed decimal format, the time when the task should resume processing.

When using the C language, you are recommended to use the FOR/UNTIL HOURS, MINUTES, and SECONDS options as C does not provide a packed decimal data type. You may use TIME, but if the value specified is not an integer constant, the application is responsible for ensuring that the value passed to CICS is in packed decimal format. See the section about expiration times in the CICS Application Programming Guide.

UNTIL
specifies the time at the end of the delay and when the task should resume processing.

Conditions

EXPIRED
occurs if the time specified has already expired when the command is issued.

Default action: ignore the condition.

INVREQ
RESP2 values:
4
Hours are out of range.
5
Minutes are out of range.
6
Seconds are out of range.

also occurs (RESP2 not set) if the DELAY command is not valid for processing by CICS.

Default action: terminate the task abnormally.

Examples

The following example shows you how to suspend the processing of a task for five minutes:
EXEC CICS DELAY
     INTERVAL(500)
     REQID('GXLBZQMR')
EXEC CICS DELAY FOR MINUTES(5)
The following example shows you how, at 09:00, to suspend the processing of a task until 12:45:
EXEC CICS DELAY
     TIME(124500)
     REQID('UNIQCODE')
There are two ways to enter the time under FOR or UNTIL.
  • A combination of at least two of HOURS(0–99), MINUTES(0–59) and SECONDS(0–59). HOURS(1) SECONDS(3) would mean one hour and three seconds (the minutes default to zero).
  • Any one of HOURS(0–99), MINUTES(0–5999), or SECONDS(0–359 999). HOURS(1) means one hour. MINUTES(62) means one hour and two minutes. SECONDS(3723) means one hour, two minutes, and three seconds.