CA IDMS COBOL program calls a subprogram passing the SUBSCHEMA-CTRL and 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?
Release : 18.5, 19.0
Component : CA ADS
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 it's 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 it's 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.
See documentation section BIND RECORD (COBOL)