dynamic" and "static" calls are NOT something that are defined in any (current or past) ANSI/ISO COBOL Standard. Exactly what these mean; how they are implemented; and what the implications are for each depend upon the COMPILER and O/S you are using.
Talking *just* about the IBM MVS, OS?390, z/OS environments, the following is true:
1) When the DYNAM compiler option is specified, ALL CALL statements are "dynamic" i.e. they are resolved at run-time - not at link-edit or binder time. (The "subprogram" must be available at run-time in Steplib, Joblib, Linklist, LPA, etc)
2) When the NODYNAM compiler option is specified, then
CALL "literal"
statements are static, while
CALL identifier
statements are dynamic
3) In all compilers that "pre-date" LE, when the DYNAM compiler option was specified, then the RES compiler option was "turned on". In LE-conforming compilers, there is ONLY "res" behavior (NOREST is no longer supported).
4) The RES compiler option determines whether IBM supplied subroutines (ILBO, IGZ, CEE, etc) are accessed dynamically at run-time (RES) or link-edited in (bound in) at link-edit time. (There are a VERY few exceptions to this rule).
5) The CANCEL statement for "statically" link-edited in user subprograms
- does NOT free storage
- does NOT place the subprogram in "initial state" (This violates the ANSI Standard, so NODYNAM is documented as non-Standard)
6) The CANCEL statement of a dynamicall called (DYNAM compiler option or CALL identifier under NODYNAM) *always* places the subprogram in "initial state" for its next CALL. It may OR MAY NOT actually free any storage. (Usually does - but no guarantee of this)
7) If you use any ENTRY statements and CALL a subprogram via different ENTRY statments and/or sometimes DYNAMICALLY and sometimes STATICALLY,
"results are unpredictable"
(and usually end up with problems)
8) The usual "issues" on deciding between making a call dynamic vs static are:
- performance
- load module size
- what type of "system" testing is required when a subprogram changes
- shop "standards"
- "subsystems" (e.g. CICS, IMS, etc) calls
9) With DLL's and OO programming, "late" versus "early" binding is similar - but not QUITE the same as static vs dynamic CALL statements.
****
*IF* you are asking about an MVS, OS/390, or z/OS environment, does this answer your questions? If you are asking about another environment, please tell us which it is.
Bill Klein