From: James S. H. \(T. C. Users\) <TinyCobolUsers@ZName.com> - 2002-02-26 08:08:11
|
===================================== But in the IBM mainframe world the default compile option is frequently NODYNAM. With that option, CALL "MYPROG" is a static call and CALL MY-PROGRAM is a dynamic call, since a variable containing the subprogram name is implied and the name could be changed during execution. Interfacing with some products, CICS for example, requires the NODYNAM option because the CICS API must be statically bound to the COBOL program. There may also be performance and maintenance considerations that determine whether you want to use static or dynamic calls for a particular COBOL program. ====================================== In the IBM mainframe world it is also important to distinguish between "compilation" and "linking" or "link editing". Preparing a program to run is a two step process. The first step, compilation, translates the COBOL (or any other language) into object code. But it does NOT resolve issues like the calls. The second step, the "link edit" step, resolves these linkages. In the IBM mainframe world there are also run time distinctions between static and dynamic linkages. A dynamic linkage references a subroutine that is "outside" of the resulting code of the linkage process. It must be located at call time, and then loaded and then executed. In addition, dynamic linkages always being in the initial state of the subroutine. That is, the Working Storage was always "initialized" at every call. A common way to force a dynamic linkage in IBM Mainframe COBOL is to place the subroutine name inside a Working Storage variable that is initialized with the subroutine name. Even if the variable is never modified it will not qualify for static linkage because it COULD be modified. A static linkage references a subroutine that is "linked" into the load module. It is present in memory, along with the mainline because it becomes, thru the link edit process, a part of the load module. Unless otherwise specified, and particularly in the "old" IBM world, static linkages produced subroutine that retained their status from call to call. That is, Working Storage was NOT initialized except on the first call and such variables retained their values from call to call. James S. Huggins ... |