Format 1
| Format 1: literal value |
 >>-VALUE--+----+--literal--------------------------------------><
'-IS-'
|
Format 1 specifies the initial value of a data item. Initialization is
independent of any BLANK WHEN ZERO or JUSTIFIED clause that is specified.
A format-1 VALUE clause specified in a data description entry that contains
or is subordinate to an OCCURS clause causes every occurrence of the associated
data item to be assigned the specified value. Each structure that contains the
DEPENDING ON phrase of the OCCURS clause is assumed to contain the maximum
number of occurrences for the purposes of VALUE initialization.
The VALUE clause must not be specified for a data description entry that
contains or is subordinate to an entry that contains either an EXTERNAL or a
REDEFINES clause. This rule does not apply to condition-name entries.
A format-1 VALUE clause can be specified for an elementary data item or
for a group item. When the VALUE clause is specified at the group level, the
group area is initialized without consideration for the subordinate entries
within the group. In addition, a VALUE clause must not be specified for
subordinate entries within the group.
For group items, the VALUE clause must not be specified if any subordinate
entries contain a JUSTIFIED or SYNCHRONIZED clause.
If the VALUE clause is specified for an alphanumeric group, all
subordinate items must be explicitly or implicitly described with USAGE
DISPLAY.
The VALUE clause must not conflict with other clauses in the data description
entry or in the data description of that entry's hierarchy.
The functions of the editing characters in a PICTURE clause are ignored in
determining the initial value of the item described. However, editing characters
are included in determining the size of the item. Therefore, any editing
characters must be included in the literal. For example, if the item is defined
as PICTURE +999.99 and the value is to be +12.34, then the VALUE clause should
be specified as VALUE “+012.34”.
A VALUE clause cannot be specified for external floating-point items.
A
data item cannot contain a VALUE clause if the prior data item contains an
OCCURS clause with the DEPENDING ON phrase.
Rules for literal values
- Wherever a literal is specified, a figurative constant can be substituted,
in accordance with the rules specified in Figurative constants.
- If the item is class numeric, the VALUE clause literal must be
numeric. If the literal defines the value of a working-storage item or
local-storage item, the literal is aligned according to the rules for
numeric moves, with one additional restriction: The literal must not
have a value that requires truncation of nonzero digits. If the literal is
signed, the associated PICTURE character-string must contain a sign symbol.
- With some exceptions, numeric literals in a VALUE clause must have a value
within the range of values indicated by the PICTURE clause for the item. For
example, for PICTURE 99PPP, the literal must be zero or within the range
1000 through 99000. For PICTURE PPP99, the literal must be within the range
0.00000 through 0.00099.
The exceptions are the following:
- If the VALUE clause is specified for an elementary alphabetic,
alphanumeric, alphanumeric-edited, or numeric-edited item described with
usage DISPLAY, the VALUE clause literal must be an alphanumeric literal or a
figurative constant. The literal is aligned according to the
alphanumeric alignment rules, with one additional restriction: the number of
characters in the literal must not exceed the size of the item.
- If the VALUE clause is specified for an elementary national,
national-edited, or numeric-edited item described with usage NATIONAL, the
VALUE clause literal must be a national or alphanumeric literal or a
figurative constant as specified in Figurative constants. The value of an alphanumeric literal is converted from its
source code representation to UTF-16 representation. The literal is aligned
according to the national alignment rules, with one additional restriction:
the number of characters in the literal must not exceed the size, in
character positions, of the item.
- If the VALUE clause is specified at the group level for an
alphanumeric group, the literal must be an alphanumeric literal or a
figurative constant as specified in Figurative constants, other than ALL national-literal. The size of
the literal must not exceed the size of the group item.
- If the VALUE clause is specified at the group level for a national
group, the literal can be an alphanumeric literal, a national literal, or
one of the figurative constants ZERO, SPACE, QUOTES, HIGH-VALUE, LOW-VALUE, symbolic
character, ALL national-literal, or ALL -literal.
The value of an alphanumeric literal is converted from its source code
representation to UTF-16 representation. Each figurative constant represents
a national character value. The size of the literal must not exceed the size
of the group item.
- A VALUE clause associated with a DBCS item must contain a DBCS literal,
the figurative constant SPACE, or the figurative constant ALL DBCS-literal.
The length of the literal must not exceed the size indicated by the data
item's PICTURE clause.
- A VALUE clause that specifies a national literal can be associated
only with a data item of class national.
- A VALUE clause that specifies a DBCS literal can be associated only
with a data item of class DBCS.
- A VALUE clause associated with a COMPUTATIONAL-1 or COMPUTATIONAL-2
(internal floating-point) item must specify a floating-point literal. In
addition, the figurative constant ZERO and both integer and decimal forms of
the zero literal can be specified in a floating-point VALUE clause.
For information about floating-point literal values, see Rules for floating-point literal values.
|