Previous Topic: BIND RECORD StatementNext Topic: Termination Statements


READY Statement

Each database area containing records to be accessed must be readied. The following example readies both the EMP-DEMO-REGION and the ORG-DEMO-REGION areas:

READY EMP-DEMO-REGION
     USAGE-MODE IS PROTECTED UPDATE.
PERFORM IDMS-STATUS.
READY ORG-DEMO-REGION
     USAGE-MODE IS RETRIEVAL.
PERFORM IDMS-STATUS.

The specified usage mode allows records within the EMP-DEMO-REGION to be updated (stored, modified, and erased) but prevents them from being updated by other programs running concurrently; records within the ORG-DEMO-REGION can only be retrieved (no updating will be allowed).

You can code a single ready statement if all areas within the subschema are to be readied with the same mode. The following statement readies all areas in a shared update mode:

READY USAGE-MODE IS UPDATE.
PERFORM IDMS-STATUS.

It is possible to define default usage modes for areas within a subschema. A program using such a subschema need not code a READY statement. If the program does code a READY statement, it must ready every area that it will access unless the FORCE option was specified for the default usage mode. Areas using the default usage mode combined with the FORCE option are automatically readied even if the run-unit already issued READY for other areas.

Note: Your program should ready all areas that it intends to access before issuing any other DML request (other than BIND RUN-UNIT and BIND RECORD). This avoids deadlocks between programs that ready areas in conflicting ways such as shared update and protected update.