HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9248
BN and BZ (blank) edit descriptors
The BN and BZ edit descriptors control the interpretation of embedded and trailing blanks in
numeric input fields. The syntax of the blank edit descriptors is:
BN
BZ
At the beginning of the execution of an input statement, blank characters within numbers are
ignored except when the unit is connected with BLANK='ZERO' specified in the OPEN
statement. BN and BZ override the BLANK= I/O specifier for the current READ statement. For
more details about the BLANK= I/O specifier, see “OPEN” on page 410.
If a BZ edit descriptor is encountered in the format specification, trailing and embedded
blanks in succeeding numeric fields are treated as zeroes. The BZ edit descriptor remains in
effect until a BN edit descriptor or the end of the format specification is encountered. If BN is
specified, all embedded blanks are removed and the input number is right justified within the
field width.
The BN and BZ edit descriptors affect only I, B, O, F, D, E, EN, ES, G, and Z format descriptors
during the execution of an input statement. The BN and BZ edit descriptors do not affect
character and logical edit descriptors.
Table 9-9 provides examples of the BN and BZ edit descriptors on input.
B8 -27 ********
Table 9-9 BN and BZ edit descriptors: input examples
Descriptor
Input
characters
BN editing in
effect
BZ editing in
effect
I4 1
b
2
b
12 1020
F6.2
b
4
b
.
b
2 4.2 40.02
E7.1 5
b
.
b
E1
b
5.0 x 10
1
5.0 x 10
11
E5.0 3E4
bb
3.0 x 10
4
3.0 x 10
400
(overflow)
Table 9-8 B Edit descriptor: output examples (Continued)
Descriptor Internal value Output