Technical data

CONNECT
General Rules
1. The current record of the run unit must be in a realm in ready update
mode and all records required by the Database Control System (DBCS) to
execute the CONNECT statement must be in a realm in available mode. The
CONNECT statement uses the current record of the run unit.
2. Use record-name to check that the current record of the run unit is a record
type identical to the record-name record type.
3. The current record of the run unit must not already be a member of set-name.
4. For each set-name in the TO clause:
a. The DBCS inserts the current record of the run unit into each set-name as
determined by the set currency indicator associated with each set-name.
b. The position where the DBCS inserts the record into the set is determined
according to the criteria for ordering the set defined in the schema for
set-name.
5. When specifying the ALL option:
a. The DBCS considers only those set types specified in your subschema for
which:
The current record is not presently a member of any occurrence of the
set type.
The record type of the current record is defined in the schema as a
member record type of the set type.
b. For each such selected set type:
The DBCS inserts the current record into the set determined by the
set currency indicator associated with the selected set type.
The position where the DBCS inserts the current record into the set
is determined according to the set-ordering criteria in the schema for
the selected set type.
6. Unless otherwise specified by the RETAINING clause (see Section 4.9.1,
RETAINING Clause), set type currency indicators for the connected sets point
to the connected record. All other currency indicators are not affected.
7. If a database exception condition occurs during the execution of a CONNECT
statement, the DBCS places a database exception condition code in the
special register DB-CONDITION (see Technical Notes). This code identifies
the condition.
8. If the execution of a CONNECT statement results in a database exception
condition, no changes are made to the membership of the current record in
the database.
Technical Notes
CONNECT 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 specifies the
position of a vacated record in a record collection.
4–24 Procedure Division