FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-111
WRITE Statement
In a TACL ASSIGN command, as in
ASSIGN FT006, , OUTPUT
In a UNIT compiler directive, as in
UNIT (6, OUTPUT)
A PRINT statement also opens unit 6 implicitly.
For more information about using unit 6 as a shared file, see the OPEN Statement 
on page 7-70.
•
If a WRITE statement causes unit 6 to be implicitly opened and your program is 
running as a NonStop process, the FORTRAN run-time library does a stack 
checkpoint to the backup process as a part of the implicit open.
•
Error conditions
If you specify lbl, and an error occurs during the write operation, the WRITE 
statement terminates, the file position becomes indeterminate, and FORTRAN 
transfers control to the statement identified by lbl. If you also specify ios, you can 
determine the error that occurred by analyzing ios.
If you specify ios, but not lbl, and an error occurs during the write operation, 
your program continues executing with the statement that follows the WRITE 
statement. You can analyze ios to determine the error that occurred, if any.
If you do not specify ios or lbl, and an error occurs, FORTRAN terminates your 
program and displays a run-time diagnostic message.
Examples
WRITE(UNIT=6) ((array(j,k), k=1,2), J=1,2)
WRITE(payfile, ERR=20, UPDATE=.TRUE.,UNLOCK=.TRUE.) payrec
WRITE(4,200, ERR=250) name, address1, address2, codenumber










