COBOL offers no language resources for unloading subroutines. Users must provide assembler programs themselves to do this (see section "UNBIND macro" in the “Binder-Loader-Starter” manual [10]).
In the event of such unloading processes, dependencies between the modules and on the COBOL runtime system in the context of CRTE must be taken into account:
While other COBOL modules are still loaded, the COBOL runtime system may not be unloaded, e.g. if the module to be unloaded is linked as an LLM or prelinked module and contains all or part of the runtime system.
When external files of COBOL programs are addressed, the COBOL runtime system must remain loaded even if all COBOL programs have been unloaded but COBOL subroutines are to be loaded dynamically again to permit further processing of the external files.
If the COBOL module to be unloaded is a class of interface definition, all modules which use or inherit from these class or interface definitions must be unloaded.
If the module to be unloaded was loaded dynamically using the "CALL identifier" from a COBOL module which was compiled with the OPTIMIZE-CALL-IDENTIFIER=YES option, the unloaded module may not be called again with the "CALL identifier".
In the case of program exchange of modules under openUTM, the requirements must also be taken into account.
The COBOL compiler does not check whether the rules have been observed.