The O field descriptor transfers octal (base 8) values and can be used with any data type. It takes the following form:
Ow[.m]
In an input statement, the O field descriptor transfers w characters from the external field and assigns them as an octal value to the corresponding I/O list element. The external field can contain only the numerals 0 through 7. It cannot contain a sign, a decimal point, or an exponent field.
An all-blank field is treated as a value of zero. An error occurs if the value of the external field exceeds the range of the corresponding list element.
The following list illustrates valid input processing using the O field descriptor (the symbol ^ represents a nonprinting space character):
Format External Field Internal Octal Value O5 32767 32767 O4 16234 1623 O3 97^ An error; the 9 is invalid in octal notation
In an output statement, the O field descriptor transfers the octal value of the corresponding I/O list element, right-justified, to an external field that is w characters long. No signs are transmitted; a negative value is transmitted in internal form.
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 m is present, the external field consists of at least m digits and is zero-filled on the left if necessary.
If m is zero and the external representation is zero, the external field is filled with blanks.
The following list illustrates valid output processing using O field descriptors (the symbol ^ represents a nonprinting space character):
Format Internal (Decimal) Value External Representation O6 32767 ^77777 O12 -32767 ^37777700001 O2 14261 ** O4 27 ^^33 O5 10.5 41050 O4.2 7 ^^07 O4.4 7 0007