Technical data
Example 5–1 prints a listing of all parts with a class code of PL.
Example 5–1 Printing a Listing of a Simple Set
PROCEDURE DIVISION.
.
.
.
100-GET-PLASTICS-CLASS.
MOVE "PL" TO CLASS_CODE
FIND FIRST CLASS USING CLASS_CODE.
200-GET-PLASTICS-PARTS.
FETCH NEXT PART WITHIN CLASS_PART
AT END GO TO 900-DONE-PLASTIC-PARTS.
*****************************************************
* Plastic parts print routine.
*****************************************************
GO TO 200-GET-PLASTICS-PARTS.
5.9.1.3 Forked Sets
A forked set has one owner record type and members of two or more different
member record types. In most forked sets, the member record types have
common data characteristics. One such example is the set type PART_INFO
in Figure 5–12, where member record types SUPPLY and PR_QUOTE both
contain information about parts.
Figure 5–12 Bachman Diagram of a Forked Set Type
SUPPLY PR_QUOTE
PART
ZK−1490−GE
PART_INFO
One advantage of a forked set type is the ability to connect many different
record types to one set type. Another advantage is that owner records need only
one set of pointers to access more than one member record type. Example 5–2
uses the forked set type shown in Figure 5–12 and the forked set occurrence in
Figure 5–13 to perform a part analysis.
Database Programming with HP COBOL 5–13