### 11.2.3.1 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). The m has no effect on input, only output.

The specified I/O list item must be of type integer or logical.

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.

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 must have at least m digits. If necessary, it is padded with leading zeros.

If m is zero, and the output list item has the value zero, the external field is filled with blanks.

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

For More Information:

- On the form for data edit descriptors, see Section 11.2.1.
- On general rules for numeric editing, see Section 11.2.2.

Previous Page Next Page Table of Contents