The indexed WRITE statement transfers output data from internal storage to external records accessed under the keyed mode of access. (The OPEN statement establishes the attributes of an indexed file.)
Indexed WRITE statements always write a new record. You should use the REWRITE statement to update an existing record.
The syntax of the indexed WRITE statement is identical to that of the sequential WRITE statement. The two statements differ only in that the indexed WRITE statement refers to a logical unit connected to an indexed file, whereas the sequential WRITE statement refers to a logical unit connected to a sequential file.
An indexed WRITE statement can be formatted or unformatted, and takes one of the following forms:
WRITE (extu,fmt [,iostat] [,err]) [iolist]
WRITE (extu [,iostat] [,err]) [iolist]
The control-list parameters are extu, fmt, iostat, and err. The I/O list parameter is iolist.