TIMEOUT


The TIMEOUT statement provides a means for intercepting file-handling statements. The TIMEOUT statement specifies an amount of time and a label.

     TIMEOUT       
    (1)            (2)                               (3) (4)                    (5)

(1) T/F execution conditions

(2) Label

(3) Application ID

(4) Numeric field name, PDF, or constant

(5) Occurrence (constant/index)

Using the Statement

If any of the read statements take longer than the amount of time specified, processing control is transferred to the statement immediately following the specified label.

Statements that can cause a TIMEOUT condition are BEG READ/END READ, READNEXT, and READ.

The numeric field or constant represents an amount of time in hundredths of a second. If the amount of time is zero and the requested record is being held by another user, the TIMEOUT condition occurs immediately. If the amount of time is not zero, a TIMEOUT condition occurs if the requested record remains held for the specified length of time. Note, however, that although APPXIO honors TIMEOUT values, other data access methods such as Oracle may not. In this case, the amount of time specified will be treated as if it were zero.

The TIMEOUT statement may be respecified at any time with another label, or the intercept may be disabled by a TIMEOUT statement with no label specified. If the intercept is disabled, the statements BEG READ/END READ, READ, and READNEXT will wait indefinitely for the requested record to become available.

Compilation Errors

A process compile error occurs if the referenced label is not defined within the same event point as the TIMEOUT or in a subroutine copied into the event point with the COPY statement.

Related Statements

BEG READ, END READ, READ, READNEXT

Example

In the following example, if the READ on the customer file takes longer than the amount of time defined in WORK WAIT COUNTER, processing control transfers to the statement following the label :CUST RECORD NOT AVAILABLE.

          TIMEOUT  :CUST RECORD NOT AVAILABLE        TAR WORK WAIT COUNTER
          READ     TAR CUSTOMER               HOLD 0 FT 0 BY CUSTOMER NO
          *        (process customer record)
          *        (branch or END to avoid executing customer not available code)
          *
          LABEL    :CUST RECORD NOT AVAILABLE
          *        (handle customer record not available condition)