# I Editing

The I edit descriptor transfers decimal integer values. It takes the following form:

Iw[.m]

The value of m (the minimum number of digits in the constant) must not exceed the value of w (the field width), unless w is zero. The m has no effect on input, only output.

The specified I/O list item must be of type integer; logical and real items are also allowed if the compiler option check format is not specified.

The G edit descriptor can be used to edit integer data; it follows the same rules as Iw.

## Rules for Input Processing

On input, the I data edit descriptor transfers w characters from an external field and assigns their integer value to the corresponding I/O list item. The external field data must be an integer constant. w must not be zero.

If the value exceeds the range of the corresponding input list item, an error occurs.

The following shows input using the I edit descriptor (the symbol ^ represents a nonprinting blank character):

    Format    Input         Value
    I4        2788          2788
    I3        -26            -26
    I9        ^^^^^^312      312

## Rules for Output Processing

On output, the I data edit descriptor transfers the value of the corresponding I/O list item, right-justified, to an external field that is w characters long.

The field consists of zero or more blanks, followed by a sign (a plus sign is optional for positive values, a minus sign is required for negative values), followed by an unsigned integer constant with no leading zeros.

If m is specified, the unsigned integer constant will have at least m digits, padded with leading zeros if necessary.

If the output list item has the value zero, and m is zero, the external field is filled with blanks; if w is also zero, the external field is one blank.

If w is zero, the external field has the minimum number of characters necessary to represent the value, left justifying the value with no leading blanks. If both w and m are zero and the internal value is zero, the external field is one blank.

The following shows output using the I edit descriptor (the symbol ^ represents a nonprinting blank character):

    Format     Value         Output
    I3          284          284
    I4         -284          -284
    I4            0          ^^^0
    I5          174          ^^174
    I2         3244          **
    I3         -473          ***
    I7           29.812      An error; the decimal point is invalid
    I4.0          0          ^^^^
    I4.2          1          ^^01
    I4.4          1          0001
    I0         -473          -473
    I0.4        242          0242

Parent topic: Integer Editing

## See Also

Forms for data edit descriptors
General rules for numeric editing