Previous Topic: BIND PROCEDURENext Topic: BIND RUN_UNIT


BIND RECORD

The BIND RECORD statement establishes addressability for a record in program variable storage. In most cases, you do not have to issue individual BIND RECORD statements, since the INCLUDE IDMS SUBSCHEMA_BINDS statement generates the necessary statements as a group. (see DML Precompiler-Directive Statements). Nevertheless, you can issue BIND RECORD commands separately as necessary (for Example, to bind several records to the same storage location). In any case, you must establish addressability for each subschema record used by your program.

After each BIND RECORD statement, your program should perform the IDMS_STATUS routine to ensure that the statement executed successfully.

Syntax
►►─── BIND RECORD (record-name) ─┬────────────────────────┬─ ; ───────────────►◄
                                 └─ TO (record-location) ─┘
Parameters
(record-name)

Names the record bound to a location in variable storage. The location corresponds to the record description copied into the program. Record-name must specify a record included in the subschema.

TO (record-location)

Optionally allows you to bind the record to a specific location. The data defined in record-location must be identical in length to the data defined in record-name.

Note: Be careful when using the TO (record-location) option. Source-object mismapping can result from improper use. If your program contains more than one copy of a given database record description, you must be sure to bind the proper record description at the proper time.

Example

The following statement binds the EMPLOYEE record:

BIND RECORD (EMPLOYEE);
Status Codes

Upon completion of the BIND RECORD 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 RECORD statement. This code usually indicates that the IDMS DB communications block (SUBSCHEMA_CTRL) is not aligned on a fullword boundary.

1408

The subschema does not contain the named record. Your program probably invoked the wrong subschema.

1418

The record was improperly bound to location 0.

1472

Insufficient memory is available to load a database procedure dynamically.

1474

An attempt to load a module from the load library or DDLDCLOD failed.