Previous Topic: COMMITNext Topic: DC RETURN (DC/UCF)


CONNECT

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.

Syntax
►►─── CONNECT RECORD (record-name) SET (set-name); ───────────────────────────►◄
Parameters
RECORD (record-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.

SET (set-name)

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.

Example

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.

Status Codes

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

0000

The request has been serviced successfully.

0705

The CONNECT would violate a duplicates-not-allowed option.

0706

Currency has not been established for the named record or set.

0708

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

0709

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

0710

The subschema specifies an access restriction that prohibits connecting the named record in the named set.

0714

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

0716

The record cannot be connected to a set in which it is already a member.

0721

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

0725

Currency has not been established for the named set type.