In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).
A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.
in static call if you made change to sub program you have to compile both programs but it is not the case with dynamic call in dynamic call if u change sub program no need to compile main program also.
for static call there are one loadmodule for both sub and main prog but for dynam there are separate loadmodules for sub and main program.
and you can change dynam to nodynam at compile time.
In DYNAM calls to cobol program by default it is NODYNAM only
u can use DYNAM to cause nonnested, separately compiled programs invoked through the CALL literal statement to be loaded (for CALL) and deleted (for CANCEL) dynamically at run time.
CALL identifier statements always result in a run-time load of the target program and are not impacted by this option.
The DYNAM compiler option must not be used by programs that are translated by the CICS translator.
If your COBOL program calls programs that have been linked as dynamic link
libraries (DLLs), then you must not use the DYNAM option. You must instead
compile the program with the NODYNAM and DLL options.