Making both static and dynamic calls

You can use both static and dynamic CALL statements in the same program if you compile the program with the NODYNAM compiler option.

About this task

In this case, with the CALL literal statement, the called subprogram will be link-edited with the main program into one program object. The CALL identifier statement results in the dynamic invocation of a separate program object.

When a dynamic CALL statement and a static CALL statement to the same subprogram are issued within one program, a second copy of the subprogram is loaded into storage. Because this arrangement does not guarantee that the subprogram will be left in its last-used state, results can be unpredictable.

Related references  
DYNAM