COBOL Manual for TNS and TNS/R Programs
Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-22
Reference Modifiers
Reference Modifiers
Reference modifiers allow you to reference an arbitrary portion of a data item’s value,
which is important in some applications. With reference modifiers, you define an
elementary item by specifying a leftmost character position within a data item and a
length for the new item. The unique data item created by reference modifiers can be
used not only as a sending item, but also as a receiving item—you can store a new
value into it.
Topics:
•
Reference Modifier Syntax
•
Rules for Reference Modifiers
Reference Modifier Syntax
identifier
is the name of a data item with USAGE DISPLAY. If it is qualified or subscripted,
the reference modifier appears after the qualifiers or subscripts.
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 identifier; it represents the leftmost
character of the portion of identifier you are selecting.
length
is an arithmetic expression. Its value must be a positive, nonzero integer; it
represents the size of the portion of identifier 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 identifier.
identifier
)
leftmost-character-position
length
(
:
VST008.vsd