Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-32
DELAY Statement
DELAY Statement
The DELAY statement delays program execution for a specified period of time.
numeric-literal
is a numeric value representing one-second units; the maximum value is 21474836.
The value must be a positive integer.
identifier
is the identifier of an integer data item representing one-second units; the maximum
value is 2,147,483,647 seconds (31 bits). This value must be a positive integer.
This statement is intended for use in situations where an error has occurred (such as a
terminal I/O error because power to the terminal is off) and the operation encountering
the error is to be retried periodically.
An alternate use of the DELAY statement (DELAY 0) causes immediate execution. For
example, this statement can be specified after a DISPLAY statement (for block mode) to
cause an immediate output of the contents of the terminal buffer to the screen.
The following example illustrates the DELAY statement:
* highest level program-unit.
loop.
CALL menu ON ERROR PERFORM analyze-error.
IF retry = 1
* delay five minutes, then retry.
DELAY 300
GO TO loop
ELSE
GO TO giveup.
analyze-error.
IF TERMINATION-STATUS = 18 AND
( TERMINATION-SUBSTATUS = 171 OR
TERMINATION-SUBSTATUS = 173 )
MOVE 1 TO retry
ELSE
MOVE 0 TO retry.
* suspend.
giveup.
EXIT PROGRAM WITH ERROR.
DELAY { numeric-literal }
{ identifier }
Note. The maximum values are enforced only at run-time; the compiler will not generate an
error for a value greater than 2,147,483,647.