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.


►►─── DISCONNECT RECORD (record-name) SET (set-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.
Specifies the set from which the named record will be disconnected. Set-name must be a set included in the subschema.
The following statement disconnects the current EMPLOYEE record from the OFFICE_EMPLOYEE set:
DISCONNECT RECORD (EMPLOYEE) SET (OFFICE_EMPLOYEE);
Upon completion of the DISCONNECT function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
Currency has not been established for the named record.
The named record is not in the subschema. The program has probably invoked the wrong subschema.
The named record's area has not been readied in one of the update usage modes.
The subschema specifies an access restriction that prohibits use of the DISCONNECT statement.
The DISCONNECT statement cannot be executed because the named record has been defined as a mandatory member of the set.
An area other than the area that contains the named record has been readied with an incorrect usage mode.
The named record is not currently a member of the specified set.
|
Copyright © 2014 CA.
All rights reserved.
|
|