RPG/400 Help


Figurative Constants

The figurative constants *BLANK/*BLANKS, *ZERO/*ZEROS, *HIVAL, *LOVAL, *ALL'x..', *ALLX'x1..' and *ON/*OFF are implied literals that can be specified without a length, because the implied length and decimal positions of a figurative constant are the same as those of the associated field. (For exceptions, see the following section, Rules for Figurative Constants.)

Figurative constants can be specified in positions 18 through 27 (factor 1) and in positions 33 through 42 (factor 2) of the calculation specifications. The following shows the reserved words and implied values for figurative constants:

Reserved Words
Implied Values
*BLANK/*BLANKS
All blanks. Valid only for character fields.
*ZERO/*ZEROS
Character/numeric fields: All zeros.
*HIVAL
Character fields: The highest collating character for the system (hexadecimal FFs).

Numeric fields: All nines with a positive sign.

*LOVAL
Character fields: The lowest collating character for the system (hexadecimal zeros).

Numeric fields: All nines with a negative sign.

*ALL'x..'
Character/numeric fields: Character string x . . is cyclically repeated to a length equal to the associated field. If the field is a numeric field, all characters within the string must be numeric (0 through 9). No sign or decimal point can be specified when *ALL'x..' is used as a numeric constant.
*ALLX'x1..'
Character fields: The hexadecimal literal X'x1..' is cyclically repeated to a length equal to the associated field.
*ON/*OFF
*ON is all ones. *OFF is all zeros. Both are only valid for character fields.


[ Top of Page | Previous Page | Next Page | Table of Contents ]