Technical data

DISCONNECT
DISCONNECT
Function
The DISCONNECT statement logically removes the current record of the run
unit from one or more sets.
General Format
DISCONNECT
record-name
FROM
set-name
...
ALL
ON ERROR stment
NOT ON ERROR stment2
END-DISCONNECT
record-name
names a subschema record type.
set-name
names a subschema set type.
stment
is an imperative statement executed for an on error condition.
stment2
is an imperative statement executed for a not on error condition.
Syntax Rules
1. The record type of record-name must be a member record type of the set type
for each set-name.
2. The same set-name cannot be specified more than once in the same
DISCONNECT statement.
General Rules
1. The DISCONNECT statement references the current record of the run unit.
2. The current record of the run unit must be in a realm in ready mode and all
records required by the DBCS to execute the DISCONNECT statement must
be in a realm in available mode.
3. Use record-name to check that the current record of the run unit has the
same record type as record-name.
4. The current record of the run unit must be an OPTIONAL member of each
set-name.
5. The record type of the current record of the run unit must be a member record
type of the set type for each set-name.
6. The DBCS removes the current record of the run unit from each set-name.
7. Use the ALL clause to remove the current record of the run unit from as
many sets as possible. The DBCS considers only those set types defined in
the subschema for which the record is an OPTIONAL member. Set types
not included in your subschema and set types of which the record is not a
4–26 Procedure Division