READY

The READY statement prepares a database area for access by DML functions and specifies the usage mode of the area.
idmscu19
The READY statement prepares a database area for access by DML functions and specifies the usage mode of the area.
The DBA can specify default usage modes in the subschema. Run-units that use such a subschema need not issue any READY statements; the areas are automatically readied in the predefined usage modes. However, if a run-unit issues a READY statement for one area, it must issue READY statements for all areas 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.
PROTECTED and EXCLUSIVE Options
The specified usage mode can be qualified with a PROTECTED option to prevent concurrent update or an EXCLUSIVE option to prevent concurrent use of areas by other run units executing under the CA IDMS/DB central version. Each area can be readied in its own usage mode. Usage modes can be changed by executing a FINISH statement (see FINISH), then starting a new run unit by issuing a BIND RUN_UNIT statement, the appropriate BIND RECORD statements, and a READY statement specifying the new usage mode.
Ready Areas Individually or Together
When the run unit readies database areas, all areas can be readied with a single READY statement or each area to be accessed can be readied individually. All areas affected explicitly or implicitly by the DML statements issued by the run unit must be readied. Other areas included in the subschema need not be readied.
Position of READY Statements
The READY statement can appear anywhere within an application program; however, to avoid runtime deadlock, the best practice is to ready all areas before issuing any other DML statements. A BIND RUN_UNIT statement must be processed successfully before a READY statement can be issued.
You can use the READY statement in both navigational and Logical Record Facility (LRF) environments.
Syntax
  ►►─── READY ─┬────────────────────┬─┬──────────────────────────────────┬─ ; ──►◄              └─ AREA (area-name) ─┘ └─┬─────────────┬─┬─ RETRIEVAL ◄ ─┬┘                                       ├─ PROTECTED ─┤ └─ UPDATE ──────┘                                       └─ EXCLUSIVE ─┘  
Parameters
  • AREA
    (area-name)
    Opens only the specified area.
    Area-name
    must be an area included in the subschema. If
    area-name
    is not specified, the READY statement opens all areas included in the subschema.
    • RETRIEVAL
      Opens the area for retrieval only and allows other concurrently executing run units to open the same area in any usage mode other than one that is exclusive. RETRIEVAL is the default.
    • UPDATE
      Opens the area for both retrieval and update and allows other concurrently executing run units to open the same area in any usage mode other than one that is exclusive or protected.
  • PROTECTED
    Prevents concurrent update of the area by run units executing under the same central version. Once a run unit has readied an area with the PROTECTED option, no other run unit can ready that area in any UPDATE usage mode until the first run unit releases it by means of the FINISH statement (see FINISH earlier in this section). A run unit cannot ready an area with the PROTECTED option if another run unit has readied the area in UPDATE usage mode or with the EXCLUSIVE option.
    If neither PROTECTED nor EXCLUSIVE is specified, the default usage mode of shared is invoked.
    If a READY statement would result in a usage mode conflict for an area, while running under the CA IDMS/DB central version, the run unit issuing the READY is placed in a wait state on the first functional database call.
  • EXCLUSIVE
    Prevents concurrent use of the area by any other run unit executing under the CA IDMS/DB central version. Once a run unit has readied an area with the EXCLUSIVE option, no other run unit can ready that area in any usage mode until the first run unit releases it.
    If neither PROTECTED nor EXCLUSIVE is specified, the default usage mode of shared is invoked.
    If a READY statement would result in a usage mode conflict for an area, while running under the CA IDMS/DB central version, the run unit issuing the READY is placed in a wait state on the first functional database call.
    Modification statements involving areas opened in one of the update usage modes are not valid if they affect sets that include records in an area opened in one of the retrieval usage modes.
Example
The following statement readies all subschema areas in a usage mode of PROTECTED UPDATE:
READY PROTECTED UPDATE;
Status Codes
Upon completion of the READY function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
  • 0000
    The request has been serviced successfully.
  • 0910
    The subschema specifies an access restriction that prohibits readying the area in the specified usage mode.
  • 0923
    The named area is not in the subschema.
  • 0928
    The run unit has attempted to ready an area that has been readied previously.
  • 0966
    The area is not available in the requested usage mode. If running in local mode, the area is locked against update. If running under the central version, either the area is offline to the central version, or an update usage mode was requested and the area is in retrieval mode to the central version.
  • 0970
    The database will not ready properly; a JCL error is the probable cause.
  • 0971
    The AREA being readied could not be found in the current DBNAME.
  • 0978
    A READY has been issued after the first functional call; it is recommended that all areas be readied before the first functional call is issued.