COBOL Manual for TNS and TNS/R Programs
Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-25
Condition-Names
qualified-name
is defined in Qualified Names.
subscript
is defined in Subscript Syntax.
leftmost-character-position
is an arithmetic expression. Its value must be a positive nonzero integer less than
or equal to the number of characters in data-name ; it represents the leftmost
character of the portion of data-name you are selecting.
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)