FORTRAN Reference Manual

Statements
FORTRAN Reference Manual—528615-001
7-53
Slash Editing
Slash Editing
The slash edit descriptor (/) indicates the end of data transfer on the current record.
On input from a file connected for sequential access, a slash descriptor causes
FORTRAN to skip the remaining part of the current record and to position the file at the
beginning of the next record, which becomes the current record. On output to a file
connected for sequential access, the slash descriptor causes FORTRAN to begin a
new record, which becomes the last and current record of the file.
For a file connected for direct access, the slash descriptor causes FORTRAN to
increase the record number by one, and to position the file at the beginning of the
record that has that record number.
Sign Control
The S, SP, and SS edit descriptors control the optional plus sign in the numeric output
field.
The SP edit descriptor directs the system to prefix each subsequent output value with
a plus sign if the value is greater than or equal to zero. However, an I w. m or I w. m. b
descriptor with m equal to 0 produces an all-blank field when the internal value is zero,
regardless of the sign control in effect.
The SS edit descriptor suppresses plus signs for positive output values.
The S descriptor is treated as an SS descriptor.
In the following example, the system produces plus signs for the first two integer
entities, and suppresses the plus sign for the subsequent real item:
FORMAT('1', SP, 2(I5), SS, F5.2)
Blank Control
The BN and BZ edit descriptors specify the interpretation of blanks in numeric input
fields. These edit descriptors override the OPEN statement’s BLANK= specifier.
The BN edit descriptor directs the formatter to ignore embedded blanks in numeric
input fields. A field of all blanks is interpreted as having a value of zero.
The BZ edit descriptor specifies that all embedded blank characters in succeeding
numeric fields be treated as zeroes.
For example, given the following input record (circumflexes indicate blanks),
10
^^
2
^^
3
the statements:
READ (6, 9) i, y
9 FORMAT (BZ, I3, F5.2)
PRINT *, i, y