The CONNECT statement establishes a record occurrence as a member of a set occurrence. The specified record must be defined as an optional automatic, optional manual, or mandatory manual member of the set.
Native VSAM users: The CONNECT statement is not valid since all sets in native VSAM data sets must be defined as mandatory automatic.
Before executing the CONNECT statement, satisfy these conditions:
Currency
Following successful execution of a CONNECT statement, the specified record is current of run unit, its record type, its area, and all sets in which it currently participates.
►►─── CONNECT RECORD (record-name) SET (set-name); ───────────────────────────►◄
Specifies the record type to be connected. Record-name must be a record included in the subschema and must be defined as an optional automatic, optional manual, or mandatory manual member of the set to which it is being connected.
Specifies the set to which the member record is to be connected. Set-name must be a set included in the subschema. The record is connected to the set in accordance with the ordering rules defined for that set in the schema.
The following statement connects the current EMPLOYEE record to the current occurrence of the OFFICE_EMPLOYEE set:
CONNECT RECORD (EMPLOYEE) SET (OFFICE_EMPLOYEE);
The following figure illustrates the steps required to connect an EMPLOYEE record to an occurrence of the OFFICE_EMPLOYEE set. To connect EMPLOYEE 459 to OFFICE 1 in the OFFICE_EMPLOYEE set, establish EMPLOYEE 459 as current of record type, locate the proper occurrence of the OFFICE record, and issue the CONNECT command.


Upon completion of the CONNECT function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
The CONNECT would violate a duplicates-not-allowed option.
Currency has not been established for the named record or set.
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 connecting the named record in the named set.
The CONNECT statement cannot be executed because the named record has been defined as a mandatory automatic member of the set.
The record cannot be connected to a set in which it is already a member.
An area other than the area of the named record has been readied with an incorrect usage mode.
Currency has not been established for the named set type.
|
Copyright © 2014 CA.
All rights reserved.
|
|