IDMS COBOL BIND RECORD and subprograms
search cancel

IDMS COBOL BIND RECORD and subprograms

book

Article ID: 137496

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

IDMS COBOL program calls a subprogram passing the SUBSCHEMA-CTRL and database records to extend the rununit. The program needs to do a BIND RECORD again on return to work properly otherwise record changes made by the program will not be updated in the database. Why is the BIND RECORD needed again?

Environment

Release: All supported releases.

Resolution

A BIND RECORD stores the address of the record in the program's working storage. The address is stored in the VSRUBFR field of the VSR control block for the record.

The command ACCEPT BIND ADDRESS will return this address.

A program that passes the SUBSCHEMA-CTRL and records to a called program is extending the rununit to that program. This way the called program uses the same rununit as the calling program.

If the called program does a BIND RECORD of the passed record against its own working storage area then the bind address of the record will change.

On return to the calling program, it would need to BIND the record again to its own working storage address otherwise it may fail trying to access the storage of the called program which may already have been freed. If it doesn't fail, any record changes made by the program will not be updated in the database because the changes are being made to an area of storage which is not the bind address of the record.