Previous Topic: ATTACH (DC/UCF)Next Topic: BIND PROCEDURE


BIND MAP (DC/UCF)

The BIND MAP statement identifies the location of a specified map request block (MRB) and initializes MRB fields. For each MRB used by your program, code a global BIND MAP statement. Global BIND MAP statements omit the RECORD (record-name) parameter. For each record defined to a map, code a record-specific BIND MAP statement. Record-specific BIND MAP statements include the RECORD (record-name) parameter.

Global and Record-Specific Versions of BIND MAP

The global and record-specific versions of the BIND MAP statement function as follows:

Typically, your program issues a global BIND MAP statement for each map, followed by a BIND MAP statement for each map record used by the program.

Including BIND MAP Statements Automatically

You can request the DML precompiler to include global and record-specific BIND MAP statements automatically by using the INCLUDE IDMS MAP_BINDS statement (see DML Precompiler-Directive Statements). This statement includes the necessary BINDS for all maps and map records defined for the program.

Altering the Address for a Map Record

Your program can alter the storage address for a map record at any time by issuing another BIND MAP statement for that record. After the initial global bind, all map records are considered unbound. Map operations that use those records have no effect on storage. After binding a map record to a storage address with a record-specific bind, subsequent map operations use that address to access the record. To unbind a map record, issue a record-specific BIND MAP statement that specifies the TO NULL option.

Syntax
►►─── BIND MAP (map-name) ─┬──────────────────────────────────────────────────►─
                           └─ RECORD (record-name) ───────────────────────────

─►────────────────────────────────────┬─ ; ───────────────────────────────────►◄
  ─┬───────────────────────────────┬──┘
   └─ TO ─┬─ NULL───────────────┬──┘
          └─ (record-location) ─┘
Parameters
map-name

Initializes the MRB associated with the named map. Map-name is the 1- to 8-character name of an existing map. The map version defaults to the version that you specify for the map with the DECLARE MAP statement.

RECORD (record-name)

Initializes the variable-storage address of the named record in the MRB. Record-name is the 1- to 32-character name of a record used by the map.

TO NULL/(record-location)

Optionally requests that the named record be unbound or specifies the address to which the record will be bound:

NULL

Requests that the DBMS not bind the named record.

record-location

Specifies the address to which the named record will be bound. Record-location is the symbolic name of a user-defined field that contains the address; record-location defaults to record-name. Subsequent I/O operations will use this area of storage for any operation associated with the record.

Example

The following statements bind the map EMPMAPLR and its five associated map records:

BIND MAP (EMPMAPLR);
BIND MAP (EMPMAPLR) RECORD (EMPLOYEE);
BIND MAP (EMPMAPLR) RECORD (DEPARTMENT);
BIND MAP (EMPMAPLR) RECORD (JOB);
BIND MAP (EMPMAPLR) RECORD (OFFICE);
BIND MAP (EMPMAPLR) RECORD (EMP-DATE-WORK-REC);
Status Codes

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

0000

The request was serviced successfully.

1472

Insufficient memory is available for load or storage allocation.

1474

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