BIND RECORD (COBOL)

The BIND RECORD statement establishes addressability for a record in program variable storage. Usually, you need not issue individual BIND RECORD statements because the necessary statements are generated as a group by the COPY IDMS SUBSCHEMA-BINDS statement (see ). However, you can issue BIND RECORD commands separately as necessary. (For example, to bind several records to the same storage location.) In any case, addressability must be established for each subschema record to be used by the program.
idmscu
The BIND RECORD statement establishes addressability for a record in program variable storage. Usually, you need not issue individual BIND RECORD statements because the necessary statements are generated as a group by the COPY IDMS SUBSCHEMA-BINDS statement (see Precompiler-Directive Statements). However, you can issue BIND RECORD commands separately as necessary. (For example, to bind several records to the same storage location.) In any case, addressability must be established for each subschema record to be used by the program.
The program should perform the IDMS-STATUS routine after each BIND RECORD statement to ensure that the statement was executed successfully. When AUTOSTATUS is in use (see AUTOSTATUS Protocols), a PERFORM IDMS-STATUS operation occurs automatically after each BIND RECORD statement. This operation occurs even when the BIND RECORD statements are generated as a group by a COPY IDMS SUBSCHEMA-BINDS statement. Use COPY IDMS SUBSCHEMA-BINDS only when AUTOSTATUS is in use.
Syntax
►►─── BIND ─┬─ 
record-name
 ─┬──────────────────────┬─┬─ . ────────────────────►◄             │               └─ TO 
record-location
 ─┘ │             │                                        │             └─ 
record-location
 WITH 
record-name
 ─────┘
Parameters
  • BIND
    record-name
    Specifies the record to bind to a location in variable storage. The specified record must be included in the subschema.
  • TO 
    record-location
     
    Specifies where to bind the record. The location corresponds to the record description that was copied into the program manually or automatically through DATA DIVISION statements. The 
    record-location
     must be the same length as 
    record-name
    Exercise caution when using the TO 
    record-location
     option. A source-object mismapping can result from improper use. When more than one copy of a given database record description is present in the program, ensure that the proper record description is bound at the proper time.
  • record-location
    WITH
    record-name
    Binds a record name literal (
    record-name
    ) with a variable storage record description (
    record-location
    ). 
    Record-name
     must specify a record that is included in the subschema.
Example
The following statement binds the EMPLOYEE record:
BIND EMPLOYEE.
Status Codes
After completion of the BIND RECORD function, the ERROR-STATUS field in the IDMS communications block indicates the outcome:
Status code
Meaning
0000
The request has been serviced successfully.
1400
The BIND RECORD statement cannot be recognized. This code usually indicates that the IDMS communications block (SUBSCHEMA-CTRL) is not aligned on a fullword boundary.
1408
The named record is not in the subschema. The program has probably invoked the wrong subschema.
1418
The record has been bound improperly to location 0.
1472
The available memory is insufficient to load a database procedure dynamically.
1474
An attempt to load a module from the load/core-image library or DDLDCLOD has failed.