Technical data
FIND
keeplist-name
names a list of database keys used by a run unit to lock records for later
reference.
record-name
names a subschema record type.
realm-name
names a subschema realm.
rec-key
is a key data item within the subschema record occurrence.
bool-expres
is a conditional expression that involves data items of the object record.
General Rules
Format 1
1. database-record must reference a record stored in a realm that is in ready
mode.
2. Execution of the FIND statement causes database-record to become the
current record of the run unit.
3. The Database Control System (DBCS) does not make a copy of the database
record available to the program. To retrieve the record you must use a
FETCH or GET statement.
4. The FOR UPDATE option puts a no-read lock on the specified record.
5. Unless otherwise specified by the RETAINING clause (see Section 4.9.1,
RETAINING Clause), the successful FIND statement causes the DBCS to
update these currency indicators to point to the selected record:
• Run unit.
• Realm.
• Record type.
• Set type. If the record is an owner record of the set type, this currency
indicator points to the selected record even if the set is empty. If the
record is a member record of the set type, this currency indicator points
to the selected record only if it is currently a member of some set of that
record type.
Format 2
6. keeplist-name identifies the object keeplist for the statement.
7. Using FIND ALL puts the database key values corresponding to each
qualifying record at the end of the object keeplist.
8. When FIND ALL keeplist-name is used, no currency indicators are affected.
9. The same rec-key can appear only once in a given USING phrase.
10. The bool-expres expression is used to specify additional requirements of a
qualifying record.
11. When FOR UPDATE is used, no-read locks may be placed on more than one
record.
4–36 Procedure Division