Technical data

FIND
All Formats
12. If a database exception condition occurs during the execution of a FIND
statement, the DBCS places a database exception condition code in the
special register DB-CONDITION (see Technical Note). This code identifies
the condition.
13. The DBCS places the database key of the record found in the special register
DB-KEY.
14. [NOT]ON ERROR and [NOT]AT END cannot be used concurrently in a Find
statement.
15. If either AT END or ON ERROR is used, it must precede USE.
16. If ON ERROR and NOT ON ERROR are used concurrently in a Find
statement, USE procedures will not be activated.
Technical Note
FIND statement execution can result in the database exception conditions
associated with the evaluation of the record selection expression.
Additional References
Section 2.2, on reserved words (database special registers)
HP COBOL Reference Manual, Chapter 6, section on scope of statements
HP COBOL Reference Manual, Chapter 6, section on AT END phrase
Section 4.6, on record selection expressions
Section 4.8.1, on database On Error condition
Section 5.14.1, on RETAINING clause
USE statement
Examples
1. Currency indicator access. To locate the following items, use the statement
listed with each item:
Current record of the run unit
FIND CURRENT.
Current record of the MAKE realm
FIND CURRENT WITHIN MAKE.
Current record of the CLASS_PART set
FIND CURRENT WITHIN CLASS_PART.
Current PART record
FIND CURRENT WITHIN PART.
2. Keeplist access. To locate the following items, use the statement listed with
each item:
(ALL) PART records with a PARTSTATUS OF H and put their dbkey
values in keeplist THREE
FIND ALL THREE PART USING PARTSTATUS
PARTSTATUS [X(1)] = H
Procedure Division 4–37