COBOL Manual for TNS/E Programs (H06.03+)
Data Fundamentals
HP COBOL Manual for TNS/E Programs—520347-003
4-25
Condition-Names
length
is an arithmetic expression. Its value must be a positive, nonzero integer; it
represents the size of the portion of data-name you are selecting. The value of
the expression
(leftmost-character-position + length ) - 1
must be less than or equal to the number of characters in data-name.
If length is absent, the defined item begins with leftmost-character-
position and ends with the last character of data-name ; thus the length of the
defined item is
(data-name-length -leftmost-character-position ) + 1
where data-name-length is the length of data-name.
Condition-Names
Often an item in a record is tested frequently by a program. Assigning a condition-
name to the item is a convenient way to refer to the item and show the significance of
the item’s value.
Every condition-name referred to in a COBOL program must be unique or capable of
being made unique through qualifiers, subscripts, or a combination of qualifiers and
subscripts. If you use qualifiers to make a condition-name unique, you can use the
conditional variable as the first qualifier. You can also use the structure of names for
the conditional variable as a qualifier. If references to a conditional variable require
subscripting, then any of its condition-names also require subscripting.
Example 4-10 defines a condition-name for the conditional variable USE-CODE.
Example 4-9. Identifiers
UNIQUE-IDENTIFIER
ITEM-1 OF GROUP-A
ELEMENT OF NAME-TABLE OF MASTER-RECORD (LAST-ACCESSES)
PROD-NAME OF ITEM-X (ITEM-DEX) (1:15)
Example 4-10. Condition-Name
01 INVENTORY.
02 PART-NUMBER OCCURS 100 TIMES.
03 PREFIX PICTURE 99.
03 USE-CODE PICTURE 9.
88 RESTRICTED-USE VALUE 1.
03 SUPPLIER-SUFFIX PICTURE 99.










