How an IDMS-DC COBOL program can "CALL" another IDMS-DC COBOL program without link-editing the sub-program as part of the calling program

Document ID : KB000021011
Last Modified Date : 14/02/2018
Show Technical Document Details


The COBOL compile option DYNAM is not supported in IDMS. However, it is still possible to dynamically invoke a subprogram.


In your mainline program you can could use a TRANSFER CONTROL statement that specifies a variable. In the code prior to this call, you would move the value of the subroutine name to this variable. This could would look something like this:

 	MOVE <subroutine_name> TO WS-SUB-NAME. 

This approach will cause the subroutine to be loaded dynamically at run-time, so that it does not need to be included in the link-edit of the mainline COBOL program. This dynamic load of the subroutine is supported even though the compile option DYNAM is not.

Both the calling and called programs must be defined to sysgen.