Technical data
Figure 5–31 State of KEEPLIST-1 After Executing Line 000160
KEEPLIST−1
vendor dbkey
Database Key
(DBKEY)
1
ORDINAL
POSITION
ZK−6063−GE
Figure 5–32 State of KEEPLIST-1 After Executing Lines 000190 and 000200
KEEPLIST−1
Database Key
(DBKEY)
ORDINAL
POSITION
ZK−6064−GE
1vendor dbkey
2supply dbkey
You can use database key values as search arguments to locate database records.
For example:
FIND 2 WITHIN KEEPLIST-1
This statement:
• Uses the value of the number 2 to locate the ordinal position of a database
key value
• Uses the database key value to find a record
The KEEP statement can also transfer database key values from one keeplist to
another. For example:
KEEP OFFSET 2 WITHIN KEEPLIST-1 USING KEEPLIST-2
This statement copies the second-positioned database key value in KEEPLIST-1
to the end of KEEPLIST-2.
The FREE statement removes database key value entries from a keeplist. For
example:
FREE ALL FROM KEEPLIST-1
This statement removes all the entries from KEEPLIST-1.
You can remove keeplist entries by identifying their ordinal position within the
keeplist. For example:
FREE 5 FROM KEEPLIST-2
Database Programming with HP COBOL 5–33