Formatted, direct-access WRITE statements translate data from binary to character form by using format specifications for editing (if any). The translated data is written to an external file that is connected for direct access.
Values can be transferred from objects of intrinsic or derived types. For derived types, values of intrinsic types are transferred from the components of intrinsic types that ultimately make up these structured objects.
If the values specified by the I/O list do not fill a record, blank characters are added to fill the record. If the I/O list specifies too many characters for the record, an error occurs.
If the format specification specifies another record, the record number is increased by one as each subsequent record is written by that output statement.
The following example shows a formatted, direct-access WRITE statement:
WRITE (2, REC=35, FMT=10) (NUM(K), K=1,10)