### 8.3.1.1 I Field Descriptor

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

    Iw[.m]

The corresponding I/O list element must have an integer or logical data type.

Input Processing

In an input statement, the I field descriptor transfers w characters from the external field and assigns them to the corresponding I/O list element as an integer value. The external data must have the form of an integer constant. It cannot contain a decimal point or exponent field.

The I field descriptor processes input in the following ways:

- If the value of the external field exceeds the range of the corresponding list element, an error occurs.

- If the first nonblank character of the external field is a minus sign, the field is treated as a negative value.

- If the first nonblank character is a plus sign or if no sign appears in the field, the field is treated as a positive value.

- If the field is blank, it is treated as a value of zero.

The following list illustrates valid input processing with the I field descriptor (the symbol ^ represents a nonprinting space character):

    Format    External Field       Internal Value

    I4        2788                 2788

    I3        -26                   -26

    I9        ^^^^^^312             312

Output Processing

In an output statement, the I field descriptor transfers the value of the corresponding I/O list element, right-justified, to an external field that is w characters long.

The I field descriptor processes output in the following ways:

- If the value does not fill the field, leading spaces are inserted.

- If the value is too large for the field, the entire field is filled with asterisks.

- If the value of the list element is negative, the field will have a minus sign as its leftmost, nonblank character. Therefore, the term w must be large enough to fit a minus sign when necessary.

- If m is present, the external field consists of at least m digits and is filled with zeros on the left, if necessary.

- If m is zero and the internal representation is zero, the external field is blank.

The following list illustrates valid output processing with the I field descriptor (the symbol ^ represents a nonprinting space character):

    Format     Internal Value       External Representation

    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

Previous Page Next Page Table of Contents