ILE COBOL Language Reference

VALUE Clause - Format 2 - Condition-Name Value

VALUE Clause - Format 2 - Condition-Name Value
 
>>-88--condition-name--+-VALUE--+----+---+---------------------->
                       |        '-IS-'   |
                       '-VALUES--+-----+-'
                                 '-ARE-'
 
   .---------------------------------------.
   V                                       |
>----literal-1--+------------------------+-+--.----------------><
                '-+-THROUGH-+--literal-2-'
                  '-THRU----'
 
 

This format associates a value, values, and/or range(s) of values with a condition-name. Each such condition-name requires a separate level-88 entry. Level-number 88 and condition-name are not part of the Format 2 VALUE clause itself. They are included in the format only for clarity.

condition-name
A user-specified name that associates a value with a conditional variable. If the associated conditional variable requires subscripts or indexes, each procedural reference to the condition-name must be subscripted or indexed as required for the conditional variable.

Condition-names are tested procedurally in condition-name conditions (see Conditional Expressions).

literal-1
When literal-1 is specified alone, the condition-name is associated with a single value.
literal-1 THROUGH literal-2
The condition-name is associated with at least one range of values. Whenever the THROUGH phrase is used, literal-1 must be less than literal-2.

+-------------------------------IBM Extension--------------------------------+

If the associated conditional variable is a DBCS data item, all the literals specified for the THROUGH phrase must be DBCS literals (or the figurative constants SPACE, SPACES). The range of DBCS literals specified for the THROUGH phrase is based on the binary collating sequence of the hexadecimal values of the DBCS characters.

If the associated conditional variable is a national data item, all the literals specified for the THROUGH phrase must be national hexadecimal literals (or the figurative constants SPACE, SPACES). The range of national hexadecimal literals specified for the THROUGH phrase is based on the binary collating sequence of the hexadecimal values of the national characters.

+----------------------------End of IBM Extension----------------------------+

Related Information:

Rules for Condition-Name Values


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]