Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

SCREEN COBOL Source Program
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
2-9
Literals
Figurative Constants
A figurative constant is a constant that has been prenamed and predefined for the
SCREEN COBOL compiler so that it can be written in the source program without
having to be defined in the Data Division. Figurative constants do not require quotation
marks. Tab le 2-5 lists and defines the figurative constants. The singular and plural
forms of the various figurative constants are equivalent in meaning.
The following rules apply to figurative constants:
When a figurative constant represents multiple characters, the length of the string
is determined by the compiler.
A figurative constant can be used wherever a literal appears in a format; when the
literal must be numeric, only ZERO, ZEROS, or ZEROES is permitted.
When a figurative constant is moved or compared to another data item, the
figurative constant is repeated on the right until its size is equal to the size of the
data item. This repetition of the figurative constant occurs regardless of whether
there is a JUSTIFIED clause for the data item.
Moving any figurative constant except SPACE or SPACES to a PIC N field is
flagged as a SCOBOLX compiler error.
Table 2-5. Figurative Constants
ZERO
ZEROS
ZEROES
Depending on the context, represents the numeric value 0 or a string of
one or more occurrences of the character 0
SPACE
SPACES
Represents one or more ASCII space characters (blanks)
HIGH-VALUE
HIGH-VALUES
Represents one or more binary 255 values. This value is the highest
value that a byte of Working-Storage can contain. This constant can be
used to initialize alphabetic and alphanumeric data items only.
LOW-VALUE
LOW-VALUES
Represents one or more binary 0 values. This value is the lowest
unsigned value that a byte of Working-Storage can contain. This
constant can be used to initialize alpha and alphanumeric data items
only.
QUOTE
QUOTES
Represents one or more quotation mark characters. Neither of these
words can be used in place of quotation mark characters around a
nonnumeric literal string.
ALL
literal
Repeats the value of
literal
, which must be a nonnumeric literal or
figurative constant other than ALL
literal
. When a figurative constant
is used, the word ALL is redundant and is used only for readability.