Previous Topic: Testing for Input Error ConditionsNext Topic: KEEP LONGTERM (DC/UCF)


KEEP CURRENT

The KEEP CURRENT statement places an explicit shared or exclusive lock on a record that is current of run unit, record, set, or area. Locks placed on records through the KEEP CURRENT function are maintained for the duration of the database transaction or until explicitly released by means of the COMMIT or FINISH statements.

Syntax
►►─── KEEP ─┬─────────────┬─ CURRENT ─┬────────────────────────┬─ ; ──────────►◄
            └─ EXCLUSIVE ─┘           ├─ RECORD (record-name) ─┤
                                      ├─ SET (set-name) ───────┤
                                      └─ AREA (area-name) ─────┘
Parameters
EXCLUSIVE

Specifies to place an exclusive lock on the current record of run unit, record, set, or area. If you do not specify EXCLUSIVE, the record receives a shared lock by default.

RECORD (record-name)/SET (set-name)/AREA (area-name)

Specifies to place the lock on the current record of the named record type, set, or area.

Example

The following example places an exclusive lock on the current EMPLOYEE record occurrence:

KEEP EXCLUSIVE CURRENT RECORD (EMPLOYEE);
Status Codes

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

0000

The request has been serviced successfully.

0606

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

0608

Either the named record or set is not in the subschema or the current record of run unit is not a member of the named set.

0610

The program's subschema specifies an access restriction that prohibits execution of the KEEP function.

0623

The named area is not in the subschema.

0626

The record to be kept has been erased.

0629

Deadlock occurred during locking of target record.