Forms:
The A edit descriptor directs the editing of character values. It can correspond to an input/output list item of type character or any other type. The kind type parameter of all characters transferred and converted is implied by the corresponding list item.
On input, if w is greater than or equal to the length (call it len) of the input list item, the rightmost len characters are taken from the input field. If the specified field width is less than len, the w characters are left-justified, with ( len - w ) trailing blanks added.
On output, if w is greater than len, the output field consists of ( w - len ) blanks followed by the len characters from the internal representation. If w is less than or equal to len, the output field consists of the leftmost w characters from the internal representation.
If w is not specified, the width of the character field is the length of the corresponding input/output list item.
Forms:
The B edit descriptor directs editing between values of any type in internal form and their binary representation. (A binary digit is either 0 or 1.)
On input, w binary digits are edited and form the internal representation for the value of the input list item. The binary digits in the input field correspond to the rightmost binary digits of the internal representation of the value assigned to the input list item. m has no effect on input.
On input, w must be greater than zero.
+---------------------------------Fortran 95---------------------------------+
On output, w can be zero. If w is zero, the output field consists of the least number of characters required to represent the output value.
+-----------------------------End of Fortran 95------------------------------+
The output field for Bw consists of zero or more leading blanks followed by the internal value in a form identical to the binary digits without leading zeros. Note that a binary constant always consists of at least one digit.
The output field for Bw.m is the same as for Bw, except that the digit string consists of at least m digits. If necessary, the digit string is padded with leading zeros. The value of m must not exceed the value of w unless w is zero. If m is zero and the value of the internal data is zero, the output field consists of only blank characters, regardless of the sign control in effect.
If m is zero, w is positive and the value of the
internal datum is zero, the output field consists of w blank
characters.
If both w and m are zero, and the value of the
internal datum is zero, the output field consists of only one blank
character.
If the nooldboz suboption of the -qxlf77 compiler option is specified (the default), asterisks are printed when the output field width is not sufficient to contain the entire output. On input, the BN and BZ edit descriptors affect the B edit descriptor.
+-------------------------------IBM Extension--------------------------------+
If the oldboz suboption of the -qxlf77 compiler option is specified, the following occurs on output:
If w is zero, the oldboz suboption will be ignored.
With the oldboz suboption, the BN and BZ edit descriptors do not affect the B edit descriptor.
+----------------------------End of IBM Extension----------------------------+
Input Format Value 111 B3 7 110 B3 6
Value Format Output Output (with -qxlf77=oldboz) (with -qxlf77=nooldboz) 7 B3 111 111 6 B5 00110 bb110 17 B6.5 b10001 b10001 17 B4.2 0001 **** 22 B6.5 b10110 b10110 22 B4.2 0110 **** 0 B5.0 bbbbb bbbbb 2 B0 10 10
Forms:
The E, D, and extended precision Q edit
descriptors direct editing between real and complex numbers in internal form
and their character representations with exponents. An E,
D, or extended precision Q edit descriptor can correspond to
an input/output list item of type real, to either part (real or imaginary) of
an input/output list item of type complex,
or to any other type in XL Fortran, as long as the length is at
least 4 bytes.
The form of the input field is the same as for F editing. e has no effect on input.
The form of the output field for a scale factor of 0 is:
>>-+-----+--+-----+--.--digit_string--decimal_exponent--------->< +- + -+ '- 0 -' '- - -' |
Edit Descriptor | Absolute Value of Exponent (with scale factor of 0) | Form of Exponent |
---|---|---|
Ew.d | |decimal_exponent| <= 99 | E±z1z2 |
Ew.d | 99<|decimal_exponent| <= 309 | ±z1z2z3 |
Ew.dEe | |decimal_exponent| <= (10e)-1 | E±z1z2...ze |
Ew.dDe * | |decimal_exponent| <= (10e)-1 * | D±z1z2...ze * |
Ew.dQe * | |decimal_exponent| <= (10e)-1 * | Q±z1z2...ze * |
Dw.d | |decimal_exponent| <= 99 | D±z1z2 |
Dw.d | 99<|decimal_exponent| <= 309 | ±z1z2z3 |
Qw.d * | |decimal_exponent| <= 99 * | Q±z1z2 * |
Qw.d * | 99<|decimal_exponent| <= 309 * | ±z1z2z3 * |
The scale factor k (see P (Scale Factor) Editing) controls decimal normalization. If -d<k<=0, the output field contains |k| leading zeros and d - |k| significant digits after the decimal point. If 0<k<d+2, the output field contains k significant digits to the left of the decimal point and d-k+1 significant digits to the right of the decimal point. You cannot use other values of k.
See Editing for additional information.
+-------------------------------IBM Extension--------------------------------+
Table 12. Floating-Point Display
Display | Meaning |
---|---|
NaNQ +NaNQ | Positive Quiet NaN (not-a-number) |
-NaNQ | Negative Quiet NaN |
NaNS +NaNS | Positive Signaling NaN |
-NaNS | Negative Signaling NaN |
INF +INF | Positive Infinity |
-INF | Negative Infinity |
+----------------------------End of IBM Extension----------------------------+
(Assume BN editing is in effect for blank interpretation.)
Input Format Value 12.34 E8.4 12.34 .1234E2 E8.4 12.34 2.E10 E12.6E1 2.E10
Value Format Output Output (with -qxlf77=noleadzero) (with -qxlf77=leadzero) 1234.56 E10.3 bb.123E+04 b0.123E+04 1234.56 D10.3 bb.123D+04 b0.123D+04
+---------------------------------Fortran 95---------------------------------+
(with -qxlf90=signedzero) (with -qxlf90=nosignedzero) -0.001 E5.2 -0.00 b0.00
+-----------------------------End of Fortran 95------------------------------+
Forms:
The EN edit descriptor produces an output field in the form of a real number in engineering notation such that the decimal exponent is divisible by 3 and the absolute value of the significand is greater than or equal to 1 and less than 1000, except when the output value is zero. The scale factor has no effect on output.
The EN edit descriptor can correspond to an input/output
list item of type real, to either part (real or imaginary) of an input/output
list item of type complex,
or to any other type in XL Fortran, as long as the length is at
least 4 bytes.
The form and interpretation of the input field is the same as for F editing.
The form of the output field is:
>>-+-----+--+-------+--.--digit_string--exp-------------------->< +- + -+ '- yyy -' '- - -' |
Edit Descriptor | Absolute Value of Exponent | Form of Exponent |
---|---|---|
ENw.d | |exp| <= 99 | E±z1z2 |
ENw.d | 99 < |exp| <= 309 | ±z1z2z3 |
ENw.dEe | |exp| <= 10e-1 | E±z1 ... ze |
For additional information on numeric editing, see Editing.
Value Format Output 3.14159 EN12.5 b3.14159E+00 1.41425D+5 EN15.5E4 141.42500E+0003 3.14159D-12 EN15.5E1 ***************
+---------------------------------Fortran 95---------------------------------+
(with -qxlf90=signedzero) (with -qxlf90=nosignedzero) -0.001 EN9.2 -1.00E-03 -1.00E-03
+-----------------------------End of Fortran 95------------------------------+
Forms:
The ES edit descriptor produces an output field in the form of a real number in scientific notation such that the absolute value of the significand is greater than or equal to 1 and less than 10, except when the output value is zero. The scale factor has no effect on output.
The ES edit descriptor can correspond to an input/output
list item of type real, to either part (real or imaginary) of an input/output
list item of type complex,
or to any other type in XL Fortran, as long as the length is at
least 4 bytes.
The form and interpretation of the input field is the same as for F editing.
The form of the output field is:
>>-+-----+--+-----+--.--digit_string--exp---------------------->< +- + -+ '- y -' '- - -' |
Edit Descriptor | Absolute Value of Exponent | Form of Exponent |
---|---|---|
ESw.d | |exp| <= 99 | E±z1z2 |
ESw.d | 99 < |exp| <= 309 | ±z1z2z3 |
ESw.dEe | |exp| <= 10e-1 | E±z1 ... ze |
For additional information on numeric editing, see Editing.
Value Format Output 31415.9 ES12.5 b3.14159E+04 14142.5D+3 ES15.5E4 bb1.41425E+0007 31415.9D-22 ES15.5E1 ***************
+---------------------------------Fortran 95---------------------------------+
(with -qxlf90=signedzero) (with -qxlf90=nosignedzero) -0.001 ES9.2 -1.00E-03 -1.00E-03
+-----------------------------End of Fortran 95------------------------------+
Form:
The F edit descriptor directs editing between real and complex numbers in internal form and their character representations without exponents.
The F edit descriptor can correspond to an input/output list item
of type real, to either part (real or imaginary) of an input/output list item
of type complex,
or to any other type in XL Fortran, as long as the length is at
least 4 bytes.
The input field for the F edit descriptor consists of, in order:
The output field for the F edit descriptor consists of, in order:
See Editing for additional information.
On input, w must be greater than zero.
+---------------------------------Fortran 95---------------------------------+
In Fortran 95 on output, w can be zero. If w is zero, the output field consists of the least number of characters required to represent the output value.
+-----------------------------End of Fortran 95------------------------------+
(Assume BN editing is in effect for blank interpretation.)
Input Format Value -100 F6.2 -1.0 2.9 F6.2 2.9 4.E+2 F6.2 400.0
Value Format Output Output (with -qxlf77=noleadzero) (with -qxlf77=leadzero) +1.2 F8.4 bb1.2000 bb1.2000 .12345 F8.3 bbbb.123 bbbb0.123 -12.34 F6.2 -12.34 -12.34
+---------------------------------Fortran 95---------------------------------+
-12.34 F0.2 -12.34 -12.34 (with -qxlf90=signedzero) (with -qxlf90=nosignedzero) -0.001 F5.2 -0.00 b0.00
+-----------------------------End of Fortran 95------------------------------+
Forms:
The G edit descriptor can correspond to an input/output list item of any type. Editing of integer data follows the rules of the I edit descriptor; editing of real and complex data follows the rules of the E or F edit descriptors (depending on the magnitude of the value); editing of logical data follows the rules of the L edit descriptor; and editing of character data follows the rules of the A edit descriptor.
If the nogedit77 suboption (the default) of the -qxlf77
option is specified, the method of representation in the output field depends
on the magnitude of the datum being edited. Let N be the magnitude of
the internal datum. If
0 < N < 0.1-0.5×10
-d-1 or N >= 10
d-0.5 or N is 0 and d is 0,
Gw.d output editing is the same as
kPE w.d output editing and
Gw.dEe output editing is the same
as kPEw.dEe output
editing, where kP refers to the scale factor ( P (Scale Factor) Editing) currently in effect. If
0.1-0.5×10-d-1 <=
N < 10d-0.5 or N is
identically 0 and d is not zero, the scale factor has no effect, and the value
of N determines the editing as follows:
Magnitude of Datum |
Equivalent Conversion |
---|---|
N = 0 |
F(w-n).(d-1),n('b') (d must not be 0) |
0.1-0.5×10-d-1 <= N < 1-0.5×10-d |
F(w-n).d,n('b') |
1-0.5×10-d <= N < 10-0.5×10-d+1 |
F(w-n).(d-1),n('b') |
10-0.5×10-d+1 <= N < 100-0.5×10-d+2 |
F(w-n).(d-2),n('b') |
... |
... |
10d-2-0.5×10-2 <= N < 10d-1-0.5×10-1 |
F(w-n).1,n('b') |
10d-1-0.5×10-1 <= N < 10d-0.5 |
F(w-n).0,n('b') |
where b is a blank. n is 4 for Gw.d and e+2 for Gw.dEe. The value of w-n must also be positive.
Note that the scale factor has no effect unless the magnitude of the datum to be edited is outside the range that permits effective use of F editing.
+-------------------------------IBM Extension--------------------------------+
If 0 < N < 0.1-0.5×10-d-1, N >= 10d-0.5, or N is 0 and d is 0, Gw.dDe output editing is the same as kPEw.dDe output editing and Gw.dQe output editing is the same as kPEw.dQe output editing.
+----------------------------End of IBM Extension----------------------------+
On output, if the gedit77 suboption of the -qxlf77 compiler option is specified, the number is converted using either E or F editing, depending on the number. The field is padded with blanks on the right as necessary. Letting N be the magnitude of the number, editing is as follows:
Magnitude of Datum | Equivalent Conversion |
---|---|
0.1 <= N < 1 1 <= N < 10 . . 10d-2 <= N < 10d-1 10d-1 <= N < 10d |
F(w-n).d, n('b') F(w-n).(d-1), n('b') . . F(w-n).1, n('b') F(w-n).0, n('b') |
See Editing for additional information.
Value Format Output Output (with -qxlf77=gedit77) (with -qxlf77=nogedit77) 0.0 G10.2 bb0.00E+00 bbb0.0 0.0995 G10.2 bb0.10E+00 bb0.10 99.5 G10.2 bb100. bb0.10E+03
Forms:
The I edit descriptor directs editing between integers in internal
form and character representations of integers. The corresponding
input/output list item can be of type integer
or any other type in XL Fortran.
w includes the optional sign.
m must have a value that is less than or equal to w,
unless w is zero in Fortran 95.
The input field for the I edit descriptor must be an optionally signed digit string, unless it is all blanks. If it is all blanks, the input field is considered to be zeros.
m is useful on output only. It has no effect on input.
On input, w must be greater than zero.
+---------------------------------Fortran 95---------------------------------+
On output, w can be zero. If w is zero, the output field consists of the least number of characters required to represent the output value.
+-----------------------------End of Fortran 95------------------------------+
The output field for the I edit descriptor consists of, in order:
For additional information about numeric editing, see editing.
If m is zero, w is positive and the value of the internal datum is zero, the output field consists of w blank characters. If both w and m are zero and the value of the internal datum is zero, the output field consists of only one blank character.
(Assume BN editing is in effect for blank interpretation.)
Input Format Value -123 I6 -123 123456 I7.5 123456 1234 I4 1234
Value Format Output -12 I7.6 -000012 12345 I5 12345
+---------------------------------Fortran 95---------------------------------+
0 I6.0 bbbbbb 0 I0.0 b 2 I0 2
+-----------------------------End of Fortran 95------------------------------+
Form:
The L edit descriptor directs editing between logical values in
internal form and their character representations. The L edit
descriptor can correspond to an input/output list item of type logical,
or any other type in XL Fortran.
The input field consists of optional blanks, followed by an optional decimal point, followed by a T for true or an F for false. w includes blanks. Any characters following the T or F are accepted on input but are ignored; therefore, the strings .TRUE. and .FALSE. are acceptable input forms.
The output field consists of T or F preceded by ( w - 1 ) blanks.
Input Format Value T L4 true .FALSE. L7 false
Value Format Output TRUE L4 bbbT FALSE L1 F
Forms:
The O edit descriptor directs editing between values of any type in internal form and their octal representation. (An octal digit is one of 0-7.)
w includes blanks.
On input, w octal digits are edited and form the internal representation for the value of the input list item. The octal digits in the input field correspond to the rightmost octal digits of the internal representation of the value assigned to the input list item. m has no effect on input.
On input, w must be greater than zero.
+---------------------------------Fortran 95---------------------------------+
On output, w can be zero. If w is zero, the output field consists of the least number of characters required to represent the output value.
+-----------------------------End of Fortran 95------------------------------+
The output field for Ow consists of zero or more leading blanks followed by the internal value in a form identical to the octal digits without leading zeros. Note that an octal constant always consists of at least one digit.
The output field for Ow.m is the same as for Ow, except that the digit string consists of at least m digits. If necessary, the digit string is padded with leading zeros. The value of m must not exceed the value of w, unless w is zero. If m is zero and the value of the internal datum is zero, the output field consists of only blank characters, regardless of the sign control in effect.
If the nooldboz suboption of the -qxlf77 compiler option is specified (the default), asterisks are printed when the output field width is not sufficient to contain the entire output. On input, the BN and BZ edit descriptors affect the O edit descriptor.
+-------------------------------IBM Extension--------------------------------+
If the oldboz suboption of the -qxlf77 compiler option is specified, the following occurs on output:
If w is zero, the oldboz suboption will be ignored.
With the oldboz suboption, the BN and BZ edit descriptors do not affect the O edit descriptor.
+----------------------------End of IBM Extension----------------------------+
If m is zero, w is positive and the value of the internal datum is zero, the output field consists of w blank characters. If both w and m are zero and the value of the internal datum is zero, the output field consists of only one blank character.
Input Format Value 123 O3 83 120 O3 80
Value Format Output Output (with -qxlf77=oldboz) (with -qxlf77=nooldboz) 80 O5 00120 bb120 83 O2 23 **
+---------------------------------Fortran 95---------------------------------+
0 O5.0 bbbbb bbbbb 0 O0.0 b b 80 O0 120 120
+-----------------------------End of Fortran 95------------------------------+
+-------------------------------IBM Extension--------------------------------+
Form:
The character count Q edit descriptor returns the number of characters remaining in an input record. The result can be used to control the rest of the input.
There also exists the extended precision Q edit descriptor. By default, XL Fortran only recognizes the extended precision Q edit descriptor described earlier. See E, D, and Q (Extended Precision) Editing for more information. To enable both Q edit descriptors, you must specify the -qqcount compiler option. See "-qqcount Option" in the User's Guide for more information.
When you specify the -qqcount compiler option, the compiler will distinguish between the two Q edit descriptors by the way the Q edit descriptor is used. If only a solitary Q is found, the compiler will interpret it as the character count Q edit descriptor. If Qw. or Qw.d is encountered, XL Fortran will interpret it as the extended precision Q edit descriptor. You should use correct format specifications with the proper separators to ensure that XL Fortran correctly interprets which Q edit descriptor you specified.
The value returned as a result of the character count Q edit descriptor depends on the length of the input record and on the current character position in that record. The value is returned into a scalar integer variable on the READ statement whose position corresponds to the position of the character count Q edit descriptor in the FORMAT statement.
The character count Q edit descriptor can read records of the following file types and access modes:
In an output operation, the character count Q edit descriptor is ignored. The corresponding output item is skipped.
@PROCESS QCOUNT CHARACTER(50) BUF INTEGER(4) NBYTES CHARACTER(60) STRING ... BUF = 'This string is 29 bytes long.' READ( BUF, FMT='(Q)' ) NBYTES WRITE( *,* ) NBYTES ! NBYTES equals 50 because the buffer BUF is 50 bytes long. READ(*,20) NBYTES, STRING 20 FORMAT(Q,A) ! NBYTES will equal the number of characters entered by the user. END
+----------------------------End of IBM Extension----------------------------+
Forms:
The Z edit descriptor directs editing between values of any type in internal form and their hexadecimal representation. (A hexadecimal digit is one of 0-9, A-F, or a-f.)
On input, w hexadecimal digits are edited and form the internal representation for the value of the input list item. The hexadecimal digits in the input field correspond to the rightmost hexadecimal digits of the internal representation of the value assigned to the input list item. m has no effect on input.
+---------------------------------Fortran 95---------------------------------+
On output, w can be zero. If w is zero, the output field consists of the least number of characters required to represent the output value.
+-----------------------------End of Fortran 95------------------------------+
The output field for Zw consists of zero or more leading blanks followed by the internal value in a form identical to the hexadecimal digits without leading zeros. Note that a hexadecimal constant always consists of at least one digit.
The output field for Zw.m is the same as
for Zw, except that the digit string consists of at least
m digits. If necessary, the digit string is padded with
leading zeros. The value of m must not exceed the value of
w,
unless w is zero.
If m is zero and the value of the internal datum is zero, the output
field consists of only blank characters, regardless of the sign control in
effect.
If m is zero, w is positive and the value of the internal datum is zero, the output field consists of w blank characters.
+---------------------------------Fortran 95---------------------------------+
If both w and m are zero and the value of the internal datum is zero, the output field consists of only one blank character.
+-----------------------------End of Fortran 95------------------------------+
If the nooldboz suboption of the -qxlf77 compiler option is specified (the default), asterisks are printed when the output field width is not sufficient to contain the entire output. On input, the BN and BZ edit descriptors affect the Z edit descriptor.
+-------------------------------IBM Extension--------------------------------+
If the oldboz suboption of the -qxlf77 compiler option is specified, the following occurs on output:
If w is zero, the oldboz suboption will be ignored.
With the oldboz suboption, the BN and BZ edit descriptors do not affect the Z edit descriptor.
+----------------------------End of IBM Extension----------------------------+
Input Format Value 0C Z2 12 7FFF Z4 32767
Value Format Output Output (with -qxlf77=oldboz) (with -qxlf77=nooldboz) -1 Z2 FF ** 12 Z4 000C bbbC
+---------------------------------Fortran 95---------------------------------+
12 Z0 C C 0 Z5.0 bbbbb bbbbb 0 Z0.0 b b
+-----------------------------End of Fortran 95------------------------------+