Previous Topic: SUBSCHEMA StatementNext Topic: LOAD Statement


USAGE-MODE Statement

Before performing database services for a given Total application program, the runtime interface readies each area defined in the generated subschema in shared update usage mode. The optional USAGE-MODE statement allows you to override the default usage mode for areas used by the Total task associated with the application program.

Syntax

Each clause of this statement (after the keyword USAGE-MODE) must occupy a line by itself and must begin in column 8. Include as many clauses as needed.

►►── USAGE-MODE ─────────────────────────────────────────────────────────────►

    ┌─────────────────────────────────────────────────────────┐
 ►──▼─┬─ total-task-name ─┬─┬─ idms-area-name ─┬─ usage-mode ─┴──────────────►◄
      └─ READY ───────────┘ └─ ALL ────────────┘

Expansion of usage-mode

►►──┬─DEFault◄────────────────────────┬──────────────────────────────────────►◄
    └─┬─────────────┬─┬─ RETrieval ─┬─┘
      ├─ SHAred ────┤ └─ UPDate ────┘
      ├─ PROtected ─┤
      └─ EXCLUSive ─┘

Parameters

USAGE-MODE

Required keyword; must occupy a line by itself and begin in column 1.

total-task-name/READY

Identifies the Total tasks that access the named area in the specified usage mode.

total-task-name

Specifies the name of the Total task as it exists in the SINON command issued by the Total application program.

Total-task-name USAGE-MODE statements must precede any READY USAGE-MODE statements.

READY

Specifies that all Total tasks that do not match total-task-name are to be readied in the named usage mode.

Total-task-name USAGE-MODE statements must precede any READY USAGE-MODE statements.

idms-area-name/ALL

Identifies the CA IDMS/DB areas affected by each USAGE-MODE statement.

idms-area-name

Identifies the CA IDMS/DB database area known to the subschema used by the runtime interface.

ALL

Specifies that the runtime interface is to issue a READY ALL DML verb, indicating to CA IDMS/DB that all areas are to be accessed in the specified usage mode. If you specify usage-mode (parameter explained hereafter) as DEFAULT, all areas are readied in the usage mode specified in the CA IDMS/DB subschema.

usage-mode

Identifies a valid CA IDMS/DB usage mode.

DEFault

Specifies that all areas are to be readied in the usage mode specified in the CA IDMS/DB subschema.

Note: DEFAULT is valid only if ALL is specified; it is not used with idms-area-name.

SHAred

Allows other run units executing concurrently under the CA IDMS/DB central version (CV) either to ready the area in shared update or shared retrieval mode (SHARED UPDATE), or to ready the area in shared update, shared retrieval, protected update, or protected retrieval mode (SHARED RETRIEVAL).

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. 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.

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.

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.

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.

Usage

Mutually-Exclusive Clauses

Do not use READY ALL and READY idms-area-name clauses in the same USAGE-MODE statement.

Do not use total-task-name ALL and total-task-name idms-area-name clauses in the same USAGE-MODE statement.

READY ALL SHARED UPDATE

The USAGE-MODE statement READY ALL SHARED UPDATE is the same as having no USAGE-MODE statements.

Bypassing DML READY Verbs

The USAGE-MODE statement READY ALL DEFAULT causes the runtime interface to bypass issuing any DML READY verbs. The areas needed for processing will be readied as specified in the subschema.

Central Version Parameters

The SHARED, PROTECTED, and EXCLUSIVE options apply only to programs running under the CA IDMS/DB central version.

Examples

Example 1

Suppose there are two tasks associated with an ETOTTBL and you wish to open the database areas associated with each task in different usage modes. USERPRG1 uses CA-IDMS-ADBEA1 and CA-IDMS-ADBEA2; USERPRG2 uses CA-IDMS-ADBEA2 and CA-IDMS-ADBEA3. Sample statements are listed as follows:

USAGE-MODE
       USERPRG1       CA-IDMS-ADBEA1   RETRIEVAL
       USERPRG1       CA-IDMS-ADBEA2   PROTECTED UPDATE
       USERPRG2       CA-IDMS-ADBEA3   EXCLUSIVE UPDATE

The areas for USERPRG1 are readied as specified in the USAGE-MODE table; for USERPRG2, CA-IDMS-ADBEA3 is readied as specified and CA-IDMS-ADBEA2 defaults to SHARED UPDATE. All areas in the subschema not readied by specific USAGE-MODE statements will be readied in SHARED UPDATE usage mode.

Example 2

Suppose you have many CA IDMS/DB areas in the subschema associated with an ETOTTBL. The task does not require access to all of the areas, so only required areas are readied. Sample statements are listed as follows:

USAGE-MODE
       USERPRG1       CA-IDMS-ADBEA1   RETRIEVAL
       USERPRG1       CA-IDMS-ADBEA2   PROTECTED UPDATE
       USERPRG2       CA-IDMS-ADBEA2   SHARED UPDATE

       USERPRG2       CA-IDMS-ADBEA3   EXCLUSIVE UPDATE
       READY          ALL          DEFAULT

The results are the same as they are for example 1, except that any other areas in the CA IDMS/DB subschema will not be readied. Any task other than USERPRG1 or USERPRG2 will have no DML READY verb generated. The last statement in the example causes any other tasks to use the default ready mode as specified in the subschema.