BIND MAP (COBOL)

The BIND MAP statement identifies the location of a map request block (MRB) and initializes the MRB fields. For each MRB that is used by a program, code a BIND MAP statement. For each record that is defined to a map, code a BIND MAP RECORD statement.
idmscu
The BIND MAP statement identifies the location of a map request block (MRB) and initializes the MRB fields. For each MRB that is used by a program, code a BIND MAP statement. For each record that is defined to a map, code a BIND MAP RECORD statement.
BIND MAP statements can be global or record-specific:
  • A
    global 
    BIND MAP statement applies to the map as a whole. The statement initializes the entire MRB and fills in the fields that apply to the map in general.
  • A
    record-specific
     BIND MAP statement applies only to the named map record. The statement initializes the variable storage address of the named record in the MRB.
Typically, a program issues a global BIND MAP statement for each map, followed by BIND MAP statements for each map record that is used by the program.
You can include global and record-specific BIND MAP statements automatically by using a COPY IDMS MAP-BINDS statement (see Precompiler-Directive Statements). This statement includes the necessary BINDS for all maps and map records that are defined for the program.
The 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 (BIND MAP), all map records are considered unbound. Map operations that use those records have no effect on storage. After a map record is bound to a storage address (BIND MAP RECORD), 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 
rec-name
 ─┬────────────────────────┬┘                                              └─ TO ─┬─ NULL ─────────┬┘                                                     └─ 
rec-location
 ─┘
Parameters
  • BIND MAP
    map-name
    Specifies an existing map. The map version defaults to the version that is specified for the map in the MAP SECTION of the program.
  • RECORD 
    rec-name
    Specifies a record that is used by the map. This value Initializes the variable storage address of the named record in the MRB.
  • TO
    Specifies whether to bind the record to a specified address. The following values are valid:
    • NULL
      Leaves the record unbound.
    • rec-location
      Binds the record to the specified address. Specify the symbolic name of a user-defined field that contains the address. 
      Rec-location
       defaults to 
      rec-name
      . Subsequent I/O operations use this area of storage for any operation that is associated with the record.
Example
The following statements bind the EMPMAPLR map 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
After completion of the BIND MAP function, the ERROR-STATUS field in the IDMS-DC communications block indicates the outcome:
Status code
Meaning
0000
The request has been serviced successfully.