XL Fortran for AIX 8.1
Language Reference
+-------------------------------IBM Extension--------------------------------+
Purpose
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.
Format
>>-WAIT--(--wait_list--)---------------------------------------><
|
- wait_list
- is a list that must contain one ID= specifier and at most one of
each of the other valid specifiers. The valid specifiers are:
- ID= integer_expr
- indicates the data transfer with which this WAIT statement is
identified. The integer_expr is a scalar of type
INTEGER(4) or default integer. To initiate an asynchronous
data transfer, the ID= specifier is used on a READ or
WRITE statement.
- IOSTAT= ios
- is an input/output status specifier that specifies the status of the
input/output operation. ios is a scalar variable of type
INTEGER(4) or default integer. When the input/output statement
containing this specifier finishes execution, ios is defined
with:
- A zero value if no error condition occurs;
- A positive value if an error occurs;
- A negative value if an end-of-file condition is encountered and no error
occurs.
The ios defined for the IOSTAT= specifier of the
asynchronous data transfer statement need not be identical to the ios
defined for the IOSTAT= specifier of the matching WAIT
statement.
- ERR= stmt_label
- is an error specifier that specifies the statement label of an executable
statement in the same scoping unit to which control is to transfer in case of
an error. Coding the ERR= specifier suppresses error
messages.
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.
- END= stmt_label
- is an end-of-file specifier that specifies a statement label at which the
program is to continue if an endfile record is encountered and no error
occurs. If an external file is positioned after the endfile record, the
IOSTAT= specifier, if present, is assigned a negative value, and the
NUM= specifier, if present, is assigned an integer value.
Coding the END= specifier suppresses the error message for
end-of-file. This specifier can be specified for a unit connected for
either sequential or direct access.
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.
- DONE= logical_variable
- specifies whether or not the asynchronous I/O statement is
complete. If the DONE= specifier is present, the
logical_variable is set to true if the asynchronous I/O is complete
and is set to false if it is not complete. If the returned value is
false, then one or more WAIT statements must be executed until either
the DONE= specifier is not present, or its returned value is
true. A WAIT statement without the DONE= specifier,
or a WAIT statement that sets the logical_variable value to
true, is the matching WAIT statement to the data transfer statement
identified by the same ID= value.
Rules
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.
Related Information
- Executing Data Transfer Statements Asynchronously
- "AIX Implementation Details of XL Fortran Input/Output" in the User's Guide
+----------------------------End of IBM Extension----------------------------+
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]