The AWAITOPEN statement is used to await a request for dialog establishment. Information on networks that support this function can be found in the I/O Subsystem Programming Guide.
<awaitopen statement>
── AWAITOPEN ── ( ──<awaitopen file part>─┬─────────────────────┬─ ) ──┤
└─<awaitopen options>─┘
<awaitopen file part>
──<file designator>─┬──────────────────────────────────┬───────────────┤
└─ [SUBFILE ──<subfile index>── ] ─┘<awaitopen options>
──┬─────────────────────────────────┬──────────────────────────────────►
└─ , ──<awaitopen control option>─┘
►─┬────────────────────────────────────┬───────────────────────────────►
└─ , ── PARTICIPATE ─┬───────────────┤
└─ = ─┬─ TRUE ──┤
└─ FALSE ─┘
►─┬────────────────────────────────┬───────────────────────────────────┤
└─ , ──<connecttimelimit option>─┘<awaitopen control option>
──┬─ AVAILABLE ─┬──────────────────────────────────────────────────────┤ ├─ DONTWAIT ──┤ └─ WAIT ──────┘
<connecttimelimit option>
── CONNECTTIMELIMIT ── = ──<arithmetic expression>─────────────────────┤
The AWAITOPEN statement can be used only when the kind of the file designator is PORT and only when the SERVICE attribute for the port is set to a network type that supports this feature.
The subfile index, if present, specifies the subfile that is waiting for dialog establishment.
The AWAITOPEN statement can be used as an arithmetic function. It returns the same values as the file attribute AVAILABLE. For a description of these values refer to the File Attributes Programming Reference Manual. If the result of this statement is not interrogated by the program, the program terminates when the awaitopen action fails.
The control options AVAILABLE, DONTWAIT, and WAIT are described in the I/O Subsystem Programming Guide. The control option is used to indicate when control should be returned to the program. If a control option is not specified, WAIT is assumed.

