The WAIT statement may be used to wait for an asynchronous data transfer to complete or it may be used to detect the completion status of an asynchronous data transfer statement.
The stmt_label defined for the END= specifier of the asynchronous data transfer statement need not be identical to the stmt_label defined for the END= specifier of the matching WAIT statement.
The stmt_label defined for the ERR= specifier of the asynchronous data transfer statement need not be identical to the stmt_label defined for the ERR= specifier of the matching WAIT statement.
is an input/output status specifier that specifies the status of the input/output operation. ios is an integer variable. When the input/output statement containing this specifier finishes execution, ios is defined with:
The ios defined for the IOSTAT= specifier of the asynchronous data transfer statement is not required to be identical to the ios defined for the IOSTAT= specifier of the matching WAIT statement.
The matching WAIT statement must be in the same scoping unit as the corresponding asynchronous data transfer statement. Within the instance of that scoping unit, the program must not execute a RETURN, END, or STOP statement before the matching WAIT statement is executed.