XL Fortran for AIX 8.1

Language Reference


Format-Directed Formatting

In format-directed formatting, editing is controlled by edit descriptors in a format specification. A format specification is specified in a FORMAT statement or as the value of a character array or character expression in a data transfer statement.

Data Edit Descriptors


Forms Use Page
A
Aw
Edits character values "A (Character) Editing"
Bw
Bw.m
Edits binary values "B (Binary) Editing"
Ew.d
Ew.dEe
Ew.dDe *
Ew.dQe *
Dw.d
ENw.d
ENw.dEe
ESw.d
ESw.dEe
Qw.d *
Edits real and complex numbers with exponents "E, D, and Q (Extended Precision) Editing"
Fw.d Edits real and complex numbers without exponents "F (Real without Exponent) Editing"
Gw.d
Gw.dEe
Gw.dDe *
Gw.dQe *
Edits data fields of any intrinsic type, with the output format adapting to the type of the data and, if the data is of type real, the magnitude of the data "G (General) Editing"
Iw
Iw.m
Edits integer numbers "I (Integer) Editing"
Lw Edits logical values "L (Logical) Editing"
Ow
Ow.m
Edits octal values "O (Octal) Editing"
Q * Returns the count of characters remaining in an input record * "Q (Character Count) Editing"
Zw
Zw.m
Edits hexadecimal values "Z (Hexadecimal) Editing"
Note:
* IBM Extensions

where:

w
specifies the width of a field, including all blanks. It must be positive except in FORTRAN 95 Begins Fortran 95, where it can be zero for I, B, O, Z, and F edit descriptors on output. FORTRAN 95 Ends

m
specifies the number of digits to be printed

d
specifies the number of digits to the right of the decimal point

e
specifies the number of digits in the exponent field

w, m, d, and e can be:

You cannot specify kind parameters for w, m, d, or e.

+-------------------------------IBM Extension--------------------------------+

Note:

There are two types of Q data edit descriptor (Qw.d and Q):

extended precision Q
is the Q edit descriptor whose syntax is Qw.d

character count Q
is the Q edit descriptor whose syntax is Q

+----------------------------End of IBM Extension----------------------------+

Control Edit Descriptors


Forms Use Page
/
r /
Specifies the end of data transfer on the current record "/ (Slash) Editing"
: Specifies the end of format control if there are no more items in the input/output list ": (Colon) Editing"
$ * Suppresses end-of-record in output * "$ (Dollar) Editing" *
BN Ignores nonleading blanks in numeric input fields "BN (Blank Null) and BZ (Blank Zero) Editing"
BZ Interprets nonleading blanks in numeric input fields as zeros "BN (Blank Null) and BZ (Blank Zero) Editing"
kP Specifies a scale factor for real and complex items "P (Scale Factor) Editing"
S SS
Specifies that plus signs are not to be written "S, SP, and SS (Sign Control) Editing"
SP Specifies that plus signs are to be written "S, SP, and SS (Sign Control) Editing"
Tc Specifies the absolute position in a record from which, or to which, the next character is transferred "T, TL, TR, and X (Positional) Editing"
TLc Specifies the relative position (backward from the current position in a record) from which, or to which, the next character is transferred "T, TL, TR, and X (Positional) Editing"
TRc Specifies the relative position (forward from the current position in a record) from which, or to which, the next character is transferred "T, TL, TR, and X (Positional) Editing"
oX Specifies the relative position (forward from the current position in a record) from which, or to which, the next character is transferred "T, TL, TR, and X (Positional) Editing"
Note:
* IBM Extension

where:

r
is a repeat specifier. It is an unsigned, positive, integer literal constant.

k
specifies the scale factor to be used. It is an optionally signed, integer literal constant.

c
specifies the character position in a record. It is an unsigned, nonzero, integer literal constant.

o
is the relative character position in a record. It is an unsigned, nonzero, integer literal constant.

+-------------------------------IBM Extension--------------------------------+

r, k, c, and o can also be expressed as an arithmetic expression enclosed by angle brackets (< and >) that evaluates into an integer value.

+----------------------------End of IBM Extension----------------------------+

Kind type parameters cannot be specified for r, k, c, or o.

Character String Edit Descriptors


Forms Use Page
nHstr Outputs a character string (str) "H Editing"
'str'
"str"
Outputs a character string (str) "Apostrophe/Double Quotation Mark Editing (Character-String Edit Descriptor)"

n
is the number of characters in a literal field. It is an unsigned, positive, integer literal constant. Blanks are included in character count. A kind type parameter cannot be specified.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]