Technical data

RECONNECT
4. For each set-name you specify in the WITHIN clause:
a. The DBCS disconnects the current record of the run unit from the set in
which it is currently a member and inserts this record in the current set
of the set-name set type.
b. The position where the DBCS inserts the record into the set is determined
by the set-ordering criteria defined in the schema for set-name.
5. If the program specifies the ALL option:
a. The DBCS considers only those set types that satisfy these requirements:
The set type is in your subschema.
The current run-unit record type is defined in the schema as an
OPTIONAL or MANDATORY member record type of the set type.
The current run-unit record is presently a member of a set of the set
type.
b. For each selected set type:
The DBCS disconnects the current record of the run unit from the
set in which it is currently a member and inserts this record in the
current set of the selected set type.
The position where the DBCS inserts the record into the set is
determined by the set-ordering criteria defined in the schema for
set-name.
6. Unless otherwise specified by the RETAINING clause (see Section 4.9.1,
RETAINING Clause), the DBCS updates the set type currency indicators for
the reconnected sets to point to the connected record.
7. If a database exception condition occurs during the execution of a
RECONNECT statement, the DBCS places a database exception condition
code in the special register DB-CONDITION (see Technical Notes). This code
identifies the condition.
Technical Notes
RECONNECT statement execution can result in these DB-CONDITION database
exception condition codes:
DBM$_CRUN_NULL The currency indicator for the run unit is null.
DBM$_CRUN_POS The currency indicator for the run unit points to a
vacated position in the database.
DBM$_WRONGRTYP The record type of record-name is not identical to the
current record type.
DBM$_CSTYP_NULL There is no current of set type for the set specified in
the TO set-name phrase. This occurs only if the set is
not a singular set.
DBM$_DUPNOTALL A sort key data item in the record to be reconnected is
the same as the sort key of a record already in the set.
DBM$_FIXED The program attempted to reconnect a FIXED member
record from one set type to another set of a given set
type.
4–54 Procedure Division