COBOL Manual for TNS/E Programs (H06.03+)

Data Fundamentals
HP COBOL Manual for TNS/E Programs520347-003
4-23
Reference Modifiers
Reference modifiers create a unique data item, which is a substring of the data
item referenced by identifier. The program handles this unique data item as
an elementary data item without the JUSTIFIED clause.
When identifier references an alphabetic data item, the unique data item has
the class and category alphabetic.
When identifier references a data item of any other category, the unique data
item has the class and category alphanumeric.
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.
Example 4-8. Reference Modifiers
A program contains these data descriptions:
01 SPREAD.
03 LTH PIC 99 VALUE 10.
03 MM.
05 FF PIC A(10) VALUE "MARGARINE ".
05 GG PIC $$9.99.
The same program contains these statements:
MOVE 3.15 TO GG
DISPLAY MM
DISPLAY MM (1:LTH)
MOVE "GONE" TO MM (11:)
DISPLAY MM
Executing the program produces these display:
MARGARINE $3.15
MARGARINE
MARGARINE GONE