Numeric Literals

A numeric literal is a character-string whose characters are selected from the digits 0 through 9, a sign character (+ or -), and the decimal point. If the literal contains no decimal point, it is an integer. (In this manual, the word integer appearing in a format represents a numeric literal that contains no decimal point. In some contexts, this literal is not permitted to have a negative value, or is not permitted to be zero. These restrictions, and any others that might be applicable, are included with the description of the format). The following rules apply:

  • One through 18 digits are allowed when the (default) compiler option *NOEXTEND or the PROCESS statement option NOEXTEND is specified.
  • IBM Extension
    One through 31 digits are allowed when the arithmetic mode compiler option *EXTEND31 or PROCESS statement option EXTEND31 is specified.
    End of IBM Extension
  • IBM Extension
    One through 34 digits are allowed when the arithmetic mode compiler option *EXTEND31FULL or PROCESS statement option EXTEND31FULL is specified.
    End of IBM Extension
  • IBM Extension
    One through 63 digits are allowed when the arithmetic mode compiler option *EXTEND63 or PROCESS statement option EXTEND63 is specified.
    End of IBM Extension
  • Only one sign character is allowed. If included, it must be the left-most character of the literal. If the literal is unsigned, it is positive in value.
  • Only one decimal point is allowed. If a decimal point is included, it is treated as an assumed decimal point (that is, as not taking up a character position in the literal). The decimal point may appear anywhere within the literal except as the right-most character.
  • If enclosed in quotation marks, the compiler treats the literal as a nonnumeric literal.

The value of a numeric literal is the algebraic quantity expressed by the characters in the literal. The size of a numeric literal in standard data format characters is equal to the number of digits specified by the user.

Every numeric literal is in the numeric data category. (Data categories are described under Classes and Categories of Data.)