Overview
For those MVS 3.8J enthusiasts using the supplied MVT COBOL (referred to as COBOL) compiler, you probably discovered that called programs must be statically linked and resolved before executing the problem (calling) program. This results in a composite load module that includes the COBOL problem program itself, COBOL ILB* subroutines and other subroutines called by the COBOL problem program. Remember, MVT COBOL is from the late 1960’s early 1970’s as today’s features were on the drawing board then !!!!!
For example: When using static calls and a called program (subroutine) undergoes maintenance (updates), it is tedious to identify what programs use the called subroutine including a relink for each program to include the revised subroutine. Why? Because the COBOL problem program executable invokes and resolves all calls from the composite load module that includes the called subroutine.
In the same scenario, if dynamic calls are utilized, the change to the subroutine (after recompilation and link-edit) would be realized at the next execution of the COBOL problem program using the called subroutine. Why? Because the COBOL problem program resolves the subroutine (utility) from a load library search before calling the subroutine.
Ed Liss provides an excellent dynamic call solution to MVT COBOL by using a ‘program wrapper’ (DYNALOAD) with a communications area. DYNALOAD, an assembler program, performs a LOAD and CALL of the subroutine at execution time. I used this approach to invoke common subroutines from various COBOL programs. And, this solution allows the subroutine to be complied/assembled and link-edited without relinking the various COBOL problem programs calling that subroutine. Yeah!!!
This original DYNALOAD zip can be obtained from Jay Moseley’s website at this URL
http://www.jaymoseley.com/hercules/misc_pgms/miscpgms.htm#Dynaload
DYNALOAD lacked one requirement for my use that may be helpful for others in the MVS 3.8J community. The requirement consists of capturing the return code from R15 after DYNALOAD invokes a subroutine and returns that value to the COBOL calling program.
The solution comprised creating DYNBLOAD (a copy of DYNALOAD to preserve original logic and authorship) with additional logic to capture R15 from the called program upon return and pass back to calling program.
Credits
DYNALOAD was written by Ed Liss as a dynamic call solution for his COBOL program inventory. See his comments in the assembler code for more details.
DYNBLOAD (copy of DYNALOAD) was modified by Larry Belmontes to return a condition code from the called subroutine to the calling program. Additionally, the communications area was increased by 4 bytes. Program documentation was updated accordingly.
Installing DYNBLOAD Software
The ZIP file contains JCL for assemble-link-edit including the DYNBLOAD assembler source program. Review the JCL and submit via HERCRDR or upload to your MVS38J system.
- Click here to download the DYNBLOAD zip file to your PC local drive.
Good luck using DYNBLOAD with your MVT COBOL programs to dynamically call other subroutines (programs).
Larry Belmontes