View previous topic :: View next topic
|
Author |
Message |
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
How can we identify just by looking at the program whether the subprogram is called Statically or Dynamically? Except below one.
Calling the Literal value is Static call and Calling the Variable is a Dynamic Call. Does it holds good in all conditions??? (i.e. Irrespective of other compiler options in effect)
Is there any other way to identify the type of call just by looking at the program? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
CALL identifier is always dynamic. CALL literal depends on compiler option.
Note, there is nothing special or different about a "main-program" or a "sub-proram" in COBOL. You can CALL an "main-program" it'll work just the same. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Is there any other way to identify the type of call just by looking at the program? |
Not without looking at the compile options -- a CALL literal may be a static call in one program and dynamic in another program based upon the compile options. |
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Depends on what compiler options? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Whether DYNAM or NODYNAM is used.
This question has been asked many times. Didn't your search-engineing reveal anything? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Code: |
If compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call
If compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call |
So answer to your original question is NO. we can't judge that by simply lookin at the program. |
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Basically my question is, In-spite of DYNAM or NODYNAM in effect. The way program is called : Literal or Identifier, does any other compiler option or any other parameter has effect on way of calling a program.
Also I think if we examine the loads, we can determine whether it is statically called or dynamically called.
Suggestions please |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Nothing else than what has been mentioned already affects whether a program is statically or dynamically CALLed. You cannot tell by looking at the source, end of story.
If you have a loadmodule (or Program Object with V5 of Enterprise COBOL) of course you can determine the difference. The code generated is different for static than for dynamic.
There must be another question underneath this, you've been clearly answered so far but are still looking... |
|
Back to top |
|
|
|