Purpose
A figurative constant is a reserved CA ADS word that represents a numeric value, a character, or a string of characters.
A figurative constant can be used as the source field in a MOVE operation or as an operand in a comparison expression.
Syntax
►►──┬───────┬──┬─ 'literal' ───┬──────────────────────────────────────────────►◄ └─ ALL ─┘ ├─ SPACEs ──────┤ ├─ ZEROs ───────┤ ├─ ZEROES ──────┤ ├─ HIGH-VALUEs ─┤ ├─ LOW-VALUEs ──┤ └─ QUOTEs ──────┘
Parameters
Specifies that the figurative constant is repeated to fill the target field in a MOVE statement.
ALL can precede 'literal'. Other figurative constants do not need to be preceded by ALL, since they always repeat to fill the target field.
A nonnumeric literal of up to 255 characters, enclosed in single quotation marks.
If ALL is specified, the literal value is repeated as many times as required to fill the field. If ALL is not specified, any remaining positions in the target field are filled with blanks.
Represents a field that contains all blanks.
Represents a field that contains all zeros.
Note: PIC X fields are treated as unsigned zoned decimal fields. ZEROS or ZEROES is the only figurative constant that can be specified in arithmetic expressions.
Represents a field filled with the character that has the highest value in the computer collating sequence (that is, X'FF').
Represents a field filled with binary zeros (that is, X'00').
Represents a field filled with single quotation marks.
Usage
The VALUE IS clause for fields in records used by an CA ADS dialog can be defined using any of the figurative constants listed in the syntax diagram. Note that the only allowable figurative constants in the VALUE IS clause for fields defined as numeric constants are ZEROS and ZEROES.
Restriction HIGH-VALUEs, LOW-VALUEs, and QUOTEs cannot be used as a source field in a MOVE statement, or as an operand in a comparison expression if the corresponding target field is a data type other than group, EBCDIC, or UNSIGNED ZONE DECIMAL.
Example 1: Moving zero to a numeric field
MOVE ZERO TO COUNTER.
Example 2: Filling a field with binary zeros
MOVE ALL 'XO' TO HUGS-AND-KISSES.
Example 3: Comparing the contents of a field
IF EMP-NAME EQ SPACES
THEN
DISPLAY TEXT 'ENTER EMPLOYEE NAME'.
|
Copyright © 2014 CA.
All rights reserved.
|
|