FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-86
PRINT Statement
Examples
POSITION(UNIT=100, IOSTAT=inerror, REC=inrecnum)
POSITION(8,ERR=30,KEY=partnum,KEYID=0,KEYLEN=5,MODE='EXACT')
POSITION(UNIT=12, KEY=pname, KEYID='PN', KEYLEN=20,
& MODE='GENERIC', COMPARELEN=8, SKIPEXACT='YES')
PRINT Statement
The PRINT statement writes data to the preconnected output unit (unit 6) only.
format
is one of the following:
°
The label of a FORMAT statement in the same program unit
°
An integer variable in which an ASSIGN statement has stored the label of a
FORMAT statement
°
The name of a character array that contains a format specification
°
A character expression that yields a format specification
°
An asterisk indicating list-directed formatting
output-list
is a list of entries, separated by commas; an entry can be any valid expression
except a character expression involving concatenation of a dummy argument
having a length specification of (*). An entry can also take the form of an implied
DO list. See Using Implied DO Lists
on page 5-27.
Considerations
•
A PRINT statement writes data from its output list to unit 6. If you have not already
established a connection for unit 6, a PRINT statement implicitly opens unit 6 using
default parameters.
•
If a PRINT 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.
•
If you specify ENV COMMON, your FORTRAN routines share access to standard
output with routines in your process written in languages other than FORTRAN
only if the access mode for unit 6 is OUTPUT. However, the default access mode
for unit 6 is I-O. If you want to share access to the file connected to unit 6 you must
set the access mode for unit 6 to OUTPUT. You can set the access mode:
PRINT format [, output-list ]










