DELAY statement

The DELAY statement suspends the execution of the next statement in the application program for the specified period of time.

Read syntax diagramSkip visual syntax diagramDELAY( expression);
expression
Specifies an expression that is evaluated and converted to FIXED BINARY(31,0). Execution is suspended for the number of milliseconds specified.

The maximum wait time is 23 hours and 59 minutes.

See the following examples:
  • delay (20); suspends execution for 20 milliseconds.
  • delay (10**3); suspends execution for one second.
  • delay (10*10**3); suspends execution for ten seconds.

When a program is running under CICS, the DELAY statement is implemented by using the EXEC CICS DELAY command. Currently the time interval for the EXEC CICS DELAY command has a minimum of one second. The milliseconds number specified in the PL/I DELAY statement is rounded down to the nearest second except when the value is less than 1 second, in which case it is set to 1.

See the following examples:
  • delay(30); suspends execution for 1 second under CICS.
  • delay(2100); suspends execution for 2 seconds under CICS.