Technical data
7. Using the PRIOR clause is equivalent to using RELATIVE –1. It refers to the
record in the object collection immediately before the current position.
8. If you use int-exp without the RELATIVE clause, the DBCS selects the record
whose ordinal position in the object collection is equal to int-exp.
•Ifint-exp is positive, the ordinal position is relative to the first record of
the object collection.
•Ifint-exp is negative, the ordinal position is relative to the last record of
the object collection.
•Ifint-exp is zero, a database exception condition occurs.
•Ifint-exp is greater than the cardinality of the collection, a database
exception condition occurs.
9. If you use the RELATIVE int-exp clause, the selected record is the one whose
ordinal position in the object collection, relative to the position specified by
the object currency indicator, is equal to int-exp.
If the object currency indicator does not specify a position in the object
collection, it is as though the RELATIVE clause did not appear.
•Ifint-exp is positive, the search in the object collection proceeds in the
next direction.
•Ifint-exp is negative, the search in the object collection proceeds in the
prior direction.
•Ifint-exp is zero, a database exception condition occurs.
• If the current position, modified by int-exp, is zero or is greater in
magnitude than the cardinality of the collection, a database exception
condition occurs.
All Formats
The record selection expression causes a database exception condition to occur if:
1. The selected set currency indicator does not identify a record (DB-
CONDITION is set to DBM$_CSTYP_NULL).
2. Int-exp is zero (DB-CONDITION is set to DBM$_BADZERO).
3. The program attempts to find or fetch a record following the last record in the
selected collection (DB-CONDITION is set to DBM$_END).
4. The program attempts to find or fetch a record preceding the first record in
the selected collection (DB-CONDITION is set to DBM$_END).
5. A realm required to carry out the record selection is not in ready mode
(DB-CONDITION is set to DBM$_NOTIP).
6. The bool-exp clause is used and any specified data item is not included in the
Subschema Record Description entry for the object record type.
See Section 4.8.3, Exception Conditions and the USE Statement statement for an
explanation of DBM$_symbolic constants.
4–14 Procedure Division