Statement: Performs a wait operation for a specified pending asynchronous data transfer operation. It takes one of the following forms:
Syntax
Description
A wait operation completes the processing of a pending data transfer operation. Each wait operation completes only a single data transfer operation, although a single statement may perform multiple wait operations.
The WAIT statement specifiers can appear in any order. An I/O unit must be specified, but the UNIT= keyword is optional if the unit specifier is the first item in the I/O control list.
The EOR= specifier only has effect if the pending data transfer operation is a nonadvancing read. The END= specifier only has effect if the pending data transfer operation is a READ.
Examples
The following example shows how the WAIT statement can be applied.
program test
integer, asynchronous, dimension(100) :: array
open (unit=1,file='asynch.dat',asynchronous='YES',&
form='unformatted')
write (1) (i,i=1,100)
rewind (1)
read (1,asynchronous='YES') array
wait(1)
write (*,*) array(1:10)
end