FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-108
WRITE Statement
ERR = lbl
lbl is the label of an executable statement in the same program unit to which 
control passes if an I/O error occurs during a WRITE statement.
UNLOCK = unlock
unlock is a logical expression that indicates how the file is to be shared 
among two or more processes.
UPDATE = upd
upd is a logical expression that indicates whether records are to be updated, 
added, or deleted.
LENGTH = len
len is an INTEGER*2 variable or array that helps you determine the last byte 
position explicitly set when writing to an internal file.
TIMEOUT = to
to is an INTEGER*2 or INTEGER*4 expression that specifies (in hundredths 
of a second) the maximum amount of time to wait for the WRITE operation to 
complete.
MSGNUM = msgno
msgno is an integer expression. For additional information, see Section 14, 
Interprocess Communication.
REPLY = reply
reply is an integer expression. For additional information, see Section 14, 
Interprocess Communication.
output-item
is a valid expression, array name, array element name, RECORD name, or 
implied DO list.
Considerations
•
Order of control specifiers
You can write the control specifiers in any order except that if you omit the UNIT 
keyword, unit must be the first item in the list. If you omit the FMT keyword, you 
must specify format as the second item in the list, and the first item must be the 
unit specifier without the UNIT keyword.
•
Use of WRITE statement










