The figurative constant values and the reserved words used to reference them are shown in the table below.
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. |
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.) |
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.) |
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". |
ALL literal | Represents one or more characters of the string of characters comprising the literal. The literal must be either a nonnumeric literal or a national literal or a figurative constant other than ALL literal. 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 or procedure-pointer values. A data item with USAGE POINTER or PROCEDURE-POINTER and with a value of NULL is guaranteed not to represent the address of any data item 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:
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.
The value associated with the QUOTE/QUOTES figurative constant is sensitive to the APOST and QUOTE directives.
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.
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.
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.