# Forms for Data Edit Descriptors

A data edit descriptor takes one of the following forms:

[r]c

[r]cw

[r]cw.m

[r]cw.d

[r]cw.d[Ee]

r | Is a repeat specification. The range of r is 1 through 2147483647 (2**31-1). If r is omitted, it is assumed to be 1.
c | Is one of the following format codes: I, B, O, Z, F, E, EN, ES, EX, D, G, L, or A.
w | Is the total number of digits in the field (the field width). If omitted, the system applies default values (see Default Widths for Data Edit Descriptors). The range of w is 1 through 2147483647 (2**31-1) on Intel® 64 architecture; 1 through 32767 (2**15-1) on IA-32 architecture. For I, B, O, Z, D, E, EN, ES, EX, F, and G, the range can start at zero.
m | Is the minimum number of digits that must be in the field (including leading zeros). The range of m is 0 through 32767 (2**15-1) on Intel® 64 architecture; 0 through 255 (2**8-1) on IA-32 architecture. w.m applies to I, B, O, and Z format edit descriptors.
d | Is the number of digits to the right of the decimal point (the significant digits). The range of d is 0 through 255. If d exceeds 255 at compile time, a warning is issued and the value 255 is used. If d exceeds 255 in a run-time format, no warning or error is issued and the value 255 is used. The number of significant digits is affected if a scale factor is specified for the data edit descriptor. For the G edit descriptor, d must be specified if w is not zero. w.d applies to F, E, EN, ES, EX, G, and D format edit descriptors.
E | Identifies an exponent field.
e | Is the number of digits in the exponent. The range of e is 0 through 255. If e exceeds 255 at compile time, a warning is issued and the value 255 is used. If e exceeds 255 in a run-time format, no warning or error is issued and the value 255 is used. For the G edit descriptor, if w is zero, e must not be specified.

## Description

Standard Fortran allows the field width to be omitted only for the A descriptor. However, Intel® Fortran allows the field width to be omitted for any data edit descriptor.

The r, w, m, d, and e must all be positive, unsigned, integer literal constants, or the digit 0 where allowed, or variable format expressions -- no kind parameter can be specified. They must not be named constants.

Actual useful ranges for r, w, m, d, and e may be constrained by record sizes (RECL) and the file system.

The data edit descriptors have the following specific forms:

Integer: | Iw[.m], Bw[.m], Ow[.m], and Zw[.m]
Real and complex: | Fw.d, Ew.d[Ee], ENw.d[Ee], ESw.d[Ee], EXw.d[Ee], Dw.d, and Gw.d[Ee]
Logical: | Lw
Character: | A[w]

The d must be specified with F, E, EN, ES, EX, D, and G field descriptors even if d is zero. The decimal point is also required. You must specify both w and d.

A repeat specification can simplify formatting. For example, the following two statements are equivalent:

    20  FORMAT (E12.4,E12.4,E12.4,I5,I5,I5,I5)

    20  FORMAT (3E12.4,4I5)

## Examples

     !  This WRITE outputs three integers, each in a five-space field
     !  and four reals in pairs of F7.2 and F5.2 values.
           INTEGER(2) int1, int2, int3
           REAL(4) r1, r2, r3, r4
           DATA int1, int2, int3 /143, 62, 999/
           DATA r1, r2, r3, r4 /2458.32, 43.78, 664.55, 73.8/
           WRITE (*,9000) int1, int2, int3, r1, r2, r3, r4
     9000  FORMAT (3I5, 2(1X, F7.2, 1X, F5.2))

The following output is produced from the above code:

      143  62  999 2458.32 43.78  664.55 73.80

Parent topic: Data Edit Descriptors

## See Also

General rules for numeric editing
Nested and group repeats