Previous Topic: DEQUEUE (DC/UCF)Next Topic: END LINE TERMINAL SESSION (DC/UCF)


DISCONNECT

The DISCONNECT statement cancels the current membership of a record occurrence in a set occurrence. The named record must be defined as an optional member of the named set.

Native VSAM users: The DISCONNECT statement is not valid since all sets in native VSAM data sets must be defined as mandatory automatic.

Before executing the DISCONNECT statement, satisfy the following conditions:

Following successful execution of the DISCONNECT statement, the named record can no longer be accessed through the set for which membership was canceled. The disconnected record can still be accessed either by means of a complete scan of the area in which it participates or directly through its db-key, if known. A disconnected record can also be accessed either through any other sets in which it participates as a member or if it has a location mode of CALC.

Currency

A successfully executed DISCONNECT statement nullifies currency in the specified set. However, next, prior, and owner of set are maintained, enabling continued access within the set. The disconnected record is current of run unit, its record type, its area, and any other sets in which it participates. The following figure illustrates the steps required to disconnect an EMPLOYEE record from an occurrence of the OFFICE_EMPLOYEE set.

To disconnect EMPLOYEE 4 from OFFICE 1 of the OFFICE_EMPLOYEE set, enter the database on OFFICE 1, establish EMPLOYEE 4 as current of the EMPLOYEE record type, and disconnect it from the OFFICE_EMPLOYEE set.

Syntax
►►─── DISCONNECT RECORD (record-name) SET (set-name); ────────────────────────►◄
Parameters
RECORD (record-name)

Specifies the record type to be disconnected. Record-name must be a record included in the subschema and must be defined as an optional member of the specified set.

SET (set-name)

Specifies the set from which the named record will be disconnected. Set-name must be a set included in the subschema.

Example

The following statement disconnects the current EMPLOYEE record from the OFFICE_EMPLOYEE set:

DISCONNECT RECORD (EMPLOYEE) SET (OFFICE_EMPLOYEE);
Status Codes

Upon completion of the DISCONNECT function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

1106

Currency has not been established for the named record.

1108

The named record is not in the subschema. The program has probably invoked the wrong subschema.

1109

The named record's area has not been readied in one of the update usage modes.

1110

The subschema specifies an access restriction that prohibits use of the DISCONNECT statement.

1115

The DISCONNECT statement cannot be executed because the named record has been defined as a mandatory member of the set.

1121

An area other than the area that contains the named record has been readied with an incorrect usage mode.

1122

The named record is not currently a member of the specified set.