Figurative constants are reserved words that name and refer to specific constant values. The reserved words for figurative constants and their meanings are:
When the figurative constant ZERO, ZEROS, or ZEROES is used in a context that requires an alphanumeric character, an alphanumeric character zero is used. When the context requires a national character zero, a national character zero is used (value NX'0030'). When the context cannot be determined, an alphanumeric character zero is used.
HIGH-VALUE is treated as an alphanumeric literal in a context that requires an alphanumeric character. For alphanumeric data with the EBCDIC collating sequence, the value is X'FF'. For other alphanumeric data, the value depends on the collating sequence indicated by the locale. For more information about locales, see Appendix G. Locale considerations.
HIGH-VALUE is treated as a national literal when used in a context that requires a national literal. The value is national character NX'FFFF'. HIGH-VALUE can be used in a context that requires a national literal only when the NCOLLSEQ(BIN) compiler option is in effect.
When the context cannot be determined, an alphanumeric context is assumed and the value X'FF' is used.
Usage note:You should not use HIGH-VALUE (or a value assigned from HIGH-VALUE) in a way that results in conversion between one data representation and another. X'FF' does not represent a valid EBCDIC or ASCII character, and NX'FFFF' does not represent a valid national character. Conversion of either the alphanumeric or the national HIGH-VALUE representation to another representation results in a substitution character. For example, conversion of X'FF' to UTF-16 would give a substitution character, not NX'FFFF'.
LOW-VALUE is treated as an alphanumeric literal in a context that requires an alphanumeric character. For alphanumeric data with the EBCDIC collating sequence, the value is X'00'. For other alphanumeric data, the value depends on the collating sequence indicated by the locale. For more information about locales, see Appendix G. Locale considerations.
LOW-VALUE is treated as a national literal when used in a context that requires a national literal. The value is national character NX'0000'. LOW-VALUE can be used in a context that requires a national literal only when the NCOLLSEQ(BIN) compiler option is in effect.
When the context cannot be determined, an alphanumeric context is assumed and the value X'00' is used.
QUOTE or QUOTES represents an alphanumeric character when used in a context that requires an alphanumeric character, and represents a national character when used in a context that requires a national character. The national character value of quotation mark is NX'0022'. The national character value of apostrophe is NX'0027'.
QUOTE and QUOTES cannot be used in place of a quotation mark or an apostrophe to enclose an alphanumeric literal.
When literal is not a figurative constant, ALL literal represents one or more occurrences of the string of characters that compose the literal.
When literal is a figurative constant, the word ALL has no meaning and is used only for readability.
The figurative constant ALL literal must not be used with the CALL, INSPECT, INVOKE, STOP, or STRING statements.
symbolic-character always represents an alphanumeric character; it can be used in a context that requires a national character only when implicit conversion of alphanumeric to national characters is defined. (It can be used, for example, in a MOVE statement where the receiving item is of class national because implicit conversion is defined when the sending item is alphanumeric and the receiving item is national.)
You cannot specify the SYMBOLIC CHARACTERS clause if a multibyte codepage is indicated by the compile-time locale setting. For more information about locales, see Appendix G. Locale considerations.
The singular and plural forms of NULL, ZERO, SPACE, HIGH-VALUE, LOW-VALUE, and QUOTE can be used interchangeably. For example, if DATA-NAME-1 is a five-character data item, each of the following statements moves five spaces to DATA-NAME-1:
MOVE SPACE TO DATA-NAME-1 MOVE SPACES TO DATA-NAME-1 MOVE ALL SPACES TO DATA-NAME-1
When the rules of COBOL permit any one spelling of a figurative constant name, any alternative spelling of that figurative constant name can be specified.
You can use a figurative constant wherever literal appears in a syntax diagram, except where explicitly prohibited. When a numeric literal appears in a syntax diagram, only the figurative constant ZERO (or ZEROS or ZEROES) can be used. Figurative constants are not allowed as function arguments except in an arithmetic expression, where the expression is an argument to a function.
The length of a figurative constant depends on the context of its use. The following rules apply: