Technical data

Figure 5–18 Retain PART_USES Currency
ZK−1496−GE
STOOL SEAT
(CURRENT OF
PART_USED_ON)
STOOL
(CURRENT OF PART_USES)
3. Build a COMPONENT record (component 1), and store it retaining PART_
USES currency. Because COMPONENT participates in the PART_USES set,
storing it normally changes the set’s currency. Therefore, executing a STORE
statement with the retaining clause keeps STOOL as current of PART_USES.
At this point, STOOL is the PART_USES owner of component 1, and STOOL
SEAT is the PART_USED_ON owner of component 1.
Since the insertion mode for COMPONENT is automatic in both set types,
a STORE COMPONENT automatically connects COMPONENT to both set
types.
300-CONNECT-COMPONENT-1.
MOVE 1 TO COMP_QUANTITY.
STORE COMPONENT RETAINING PART_USES.
Figure 5–19 COMPONENT Is Connected to Both Set Types
COMPONENT 1
STOOL
STOOL SEAT
(CURRENT OF PART_USES)
(CURRENT OF PART_USED_ON)
ZK−1497−GE
4. Use the FIND statement to locate the stool legs, again retaining PART_USES
currency, thus keeping STOOL current of PART_USES.
400-FIND-STOOL-LEGS.
MOVE "STOOL LEGS" TO PART_DESC.
FIND FIRST PART USING PART_DESC
RETAINING PART_USES.
Database Programming with HP COBOL 5–19