Previous Topic: BIND RECORDNext Topic: BIND TASK (DC/UCF)


BIND RUN_UNIT

The BIND RUN_UNIT statement:

BIND RUN_UNIT must be the first functional DML call passed to the DBMS at execution time. BIND RUN_UNIT must logically precede all other DML statements (for example, BIND RECORD, READY, FIND) in your program.

When You Do Not Need BIND RUN_UNIT

If you use the INCLUDE IDMS SUBSCHEMA_BINDS statement (see DML Precompiler-Directive Statements) in your program, you do not need the BIND RUN_UNIT statement. INCLUDE IDMS SUBSCHEMA_BINDS automatically invokes the necessary binds.

Program Registration

Some sites require program registration, that is, they require all programs to be registered in the dictionary before compilation. If your site requires program registration, your program must initialize the PROGRAM_NAME field of the IDMS communications block either automatically or manually:

Automatically

A PL/I assignment statement automatically generated by INCLUDE IDMS SUBSCHEMA_BINDS moves the program name to the PROGRAM_NAME field.

Manually

You code a PL/I assignment statement prior to the BIND RUN_UNIT statement. For Example:

PROGRAM_NAME = 'EMPDISP';

You can use the BIND RUN_UNIT statement in both the navigational and Logical Record Facility (LRF) environments.

Syntax
►►─── BIND RUN_UNIT ─┬──────────────────────────────┬─────────────────────────►
                     └─ SUBSCHEMA (subschema-name) ─┘

 ►─┬─────────────────────────────┬────────────────────────────────────────────►
   └─┬─ DBNODE ───┬─ (nodename) ─┘
     └─ NODENAME ─┘

 ►─┬──────────────────────────┬─┬───────────────────────┬─────────────────────►
   └─ DBNAME (database-name) ─┘ └─ DICTNODE (nodename) ─┘

 ►─┬──────────────────────────────┬─ ; ───────────────────────────────────────►◄
   └─ DICTNAME (dictionary-name) ─┘
Parameters
SUBSCHEMA (subschema-name)

Identifies a subschema view other than that specified in the DECLARE SUBSCHEMA statement. Subschema-name must be the 1- to 8-character name of a subschema.

Note: You should use the SUBSCHEMA subschema-name option carefully. Improper use can lead to mismapping between the named subschema and record descriptions in variable storage.

DBNODE/NODENAME (nodename)

Specifies the node where the database resides. Nodename is either the symbolic name of a user-defined 8-character field in variable storage or the node name itself, enclosed in single quotation marks. The keywords DBNODE and NODENAME are synonymous.

DBNAME (database-name)

Names the database to be accessed by the run unit. Database-name is either the symbolic name of a user-defined 8-character field in variable storage, or the database name itself enclosed in single quotation marks.

DICTNODE (nodename)

Names the node that controls the data dictionary where the subschema resides. Nodename is either the symbolic name of a user-defined 8-character field in variable storage, or the nodename itself enclosed in single quotation marks.

DICTNAME (dictionary-name)

Names the dictionary where the subschema resides. Dictionary-name is either the symbolic name of a user-defined 8-character field in variable storage, or the dictionary name itself enclosed in single quotation marks.

Note: Specifying DBNODE, DBNAME, DICTNODE, and DICTNAME as BIND RUN_UNIT parameters overrides any corresponding parameters set using the system DCUF SET statement (online) or the SYSIDMS job stream parameters (batch).

More information:

Example

The following example illustrates how a batch program accesses a subschema, EMPSS01, stored in dictionary PRODICT1 at node DEVT. The run unit accesses database PRODDB1 at the same node.

BIND RUN_UNIT SUBSCHEMA (EMPSS01) NODENAME (DEVT)
  DBNAME (PRODDB1) DICTNODE (DEVT) DICTNAME (PRODICT1);
Status Codes

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

0000

The request was serviced successfully.

1400

The DBMS cannot recognize the BIND RUN_UNIT statement. This code usually indicates that the IDMS DB communications block (SUBSCHEMA_CTRL) is not aligned on a fullword boundary.

1417

The transaction manager encountered an error. See the log for additional information.

1467

The subschema invoked does not match the subschema object tables.

1469

The run unit is not bound to the DBMS. This code indicates that the central version is not active, that the central version is not accepting new run units, or that the run unit's connection to the central version is broken due to timeout or other factors, as noted on the CV log.

1470

A journal file will not open (local mode only); the most probable cause is that the JCL doesn't correctly specify the journal file.

1472

The available memory is insufficient to load a subschema or database procedure dynamically.

1473

The central version is not accepting new run units.

1474

The subschema was not found in the dictionary load area or in the load library.

1477

The run unit was already bound.

1480

The node specified in the DBNODE clause is not active or was disabled from the system generation configuration.

1481

IDMS does not know the database specified in the DBNAME clause.

1482

The named subschema is not valid under the database specified in the DBNAME clause.

1483

The available memory is insufficient to allocate native VSAM work areas.