Figurative Constant Values

Figurative constant values are generated by your COBOL system and referenced through the use of the reserved words given below. These words must not be bounded by quotation marks when used as figurative constants. The singular and plural forms of figurative constants are equivalent and can be used interchangeably.

The figurative constant values and the reserved words used to reference them are shown in the table below.

Table 1. Figurative Constants and Their Reserved Words
Constant Representation
ZERO ZEROS ZEROES Represents the value "0", or one or more of the character "0" depending on the context.
SPACE SPACES Represents one or more of the character space from the computer's character set.

ENTMF The national space character has the value NX'0020', and the UTF-8 space character has the value UX'20'.

HIGH-VALUE HIGH-VALUES Represents one or more of the character that has the highest ordinal position in the program collating sequence. (x"FF" for the extended ASCII character set.)

ENTMF When a HIGH-VALUE national literal is required, the national character value NX'FFFF' is used. When a HIGH-VALUE UTF-8 literal is required, UX'F48FBFBF' is used, which corresponds to Unicode code point U+10FFFF, except when HIGH-VALUE is used in a MOVE or COMPARE operation with a fixed byte-length UTF-8 data item that has a length that is not a multiple of 4 bytes. In that case, when moved into or compared against, the final 3, 2 or 1 byte(s) of the UTF-8 data item, the value is UX'EFBFBF' (U+FFFF), UX'DFBF' (U+07FF), and UX'7F' (U+007F), respectively.

LOW-VALUE LOW-VALUES Represents one or more of the character that has the lowest ordinal position in the program collating sequence. (x"00" for the ASCII character set.)

ENTMF When a LOW-VALUE UTF-8 literal is required, UX'00' is used, which corresponds to Unicode code point U+00.

QUOTE QUOTES Represents one or more of the character """. The word QUOTE or QUOTES cannot be used in place of a quotation mark in a source program to bound a nonnumeric literal. Thus QUOTE ABD QUOTE is incorrect as a way of stating "ABD".

ENTMF The national character value for a quotation mark is NX'0022', and the national value for an apostrophe is NX'0027'. The UTF-8 character value for a quotation mark is UX'22', and the UTF-8 value for an apostrophe is NX'27'.

ALL literal Represents one or more characters of the string of characters comprising the literal. The literal must be either a nonnumeric literal or

ISO2002MF a national literal,

ENTMF a UTF-8 literal, or

a figurative constant other than ALL literal.

ISO2002MFXOPEN This nonnumeric literal and this national literal may be concatenation expressions.

When a figurative constant is used, the word ALL is redundant and is used for readability only.
NULL NULLS

Represents one or more unset pointer

MFCOB370 or procedure-pointer

values. A data item with

MFCOB370 USAGE POINTER

ENTMF or USAGE POINTER-32

or PROCEDURE-POINTER

and with a value of NULL is guaranteed not to represent the address of any data item

ENTMFCOB370 or procedure

.

The NULL value varies between environments and is generally consistent with the equivalent value used in non-COBOL languages for each environment.

When a figurative constant represents a string of one or more characters, the length of the string is determined by your COBOL system from context by applying the following rules in order:

  1. ISO2002MFXOPEN When a figurative constant is specified in a concatenation expression, the length of the string is one character.
  2. When a figurative constant is either specified in a VALUE clause, or associated with another data item, (for example, when the figurative constant is moved to or compared with another data item), the string of characters specified is repeated character by character on the right until the size of the resultant string is greater than or equal to the number of character positions in the associated data item. This resultant string is then truncated from the right until the number of character positions remaining is equal either to 1 or to the number of character positions in the associated data item, whichever is greater. This is done prior to and independent of the application of any JUSTIFIED clause that can be associated with the data item.
  3. When a figurative constant is other than ALL literal, the length of the string is one character.
  4. The length of the string is the length of the literal.

    MF Use of figurative constants in Format 3 DISPLAY statements has specific effects, described in the General Rules for that statement.

A figurative constant can be used wherever a literal appears in a format, except that whenever the literal is restricted to having only numeric characters in it, the only figurative constant permitted is ZERO (ZEROS, ZEROES).

When the figurative constants HIGH-VALUE(S) or LOW-VALUE(S) are used , the actual character associated with each figurative constant depends upon the program collating sequence specified. (See the topics The Object-Computer Paragraph and the The Special-Names Paragraph.)

Each reserved word that is used to reference a figurative constant value is a distinct character-string, with the exception of the construction "ALL literal" which is composed of two distinct character-strings.

OSVSVSC2MF  The value associated with the QUOTE/QUOTES figurative constant is sensitive to the APOST and QUOTE directives.

ANS85 The figurative constant ALL literal, when associated with a numeric or numeric edited item, and when its length is greater than one, is classed as an obsolete element in the ANSI'85 standard and is scheduled to be deleted from the next full revision of the ANSI Standard.

MF All dialects within this COBOL implementation fully support this obsolete ALL literal syntax. The FLAGSTD directive can be used to detect all occurrences of this syntax.

XOPEN Although this obsolete ALL literal syntax is a part of the standard COBOL definition, this syntax is explicitly excluded from the X/Open COBOL language definitions and should not be used in a conforming X/Open COBOL source program.