Technical data

FETCH
Section 4.8.1, on database On Error condition
Section 5.14.1, on RETAINING clause
USE statement
Examples
1. Currency indicator access. To retrieve the:
Current record of the run unit
FETCH CURRENT.
Current record of the MAKE realm
FETCH CURRENT WITHIN MAKE.
Current record of the CLASS_PART set
FETCH CURRENT WITHIN CLASS_PART.
Current PART record
FETCH CURRENT WITHIN PART.
2. Keeplist access. To retrieve the:
First entry in the keeplist
FETCH FIRST WITHIN KEEPLIST-A.
Last entry in the keeplist
FETCH LAST WITHIN KEEPLIST-B.
N(th) entry in the keeplist
FETCH OFFSET RECORD-COUNT WITHIN KEEPLIST-C.
3. Set owner access. To retrieve the owner (PART) of the PART_USES set:
FETCH OWNER WITHIN PART_USES.
4. Record search access. To retrieve the:
First member within the PART_USES set
FETCH FIRST WITHIN PART_USES.
First part whose PART-COST is greater than 300 dollars
FETCH FIRST PART WHERE PARTCOST GREATER THAN 300
Last member within the BUY realm
FETCH LAST WITHIN BUY.
Next COMPONENT record in the PART_USED_ON set
FETCH NEXT COMPONENT WITHIN PART_USED_ON.
Prior COMPONENT record in the PART_USES set using COMP_SUB_
PART and COMP_OWNER_PART as record keys
FETCH PRIOR COMPONENT WITHIN PART_USES
USING COMP_SUB_PART, COMP_OWNER_PART.
Procedure Division 4–33