Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL STATIC and DYNAMIC CALL 1

Status
Not open for further replies.

ashykhanna

Programmer
May 27, 2002
14
IN
Hi,
I need to know the difference between Static and Dynamic call and how its used in programs.
Also, i want to know wat will happen if you call a program dynamically in the code and give NODYNAM option in the cobol compiler and vice versa.

Thanks in advance,

Ashok
 
Do a keyword search in this forum for static dynamic call

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top