View previous topic :: View next topic
|
Author |
Message |
pbgunasekar
New User
Joined: 28 May 2005 Posts: 26 Location: Chennai
|
|
|
|
hello ,
program A calls Program B with static call and progB calls Prog C static call.. if i modified ProgC what is the order of compile? |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
C -> B -> A. |
|
Back to top |
|
|
sree_2503
New User
Joined: 22 May 2005 Posts: 12 Location: Chennai,India
|
|
|
|
Hi Gunasekar,
Static CALLS :
---------------
In COBOL, you normally call a subroutine like this:
CALL 'A' USING arguments
The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.
This is the static form of a subroutine call. The compiler generates object code for this which will cause the linker to copy the object module a.obj into your executable when it is linked.
So, if you modify "A" and recompile it, you must also relink all of the executables that call "A", because the each of the executables contains its own copy of "A".
Dynamic CALLS:
-------------------
In COBOL, the dynamic form of a subroutine call is coded like this:
01 SUBROUTINE-A PIC X(8) VALUE 'A'.
CALL SUBROUTINE-A USING arguments
The dynamic form of the CALL statement specifies the name of the subroutine using a variable; the variable contains the name of the subroutine to be invoked.
The difference is that the name of the subroutine is found in the variable SUBROUTINE-A. The compiled code will cause the operating system to load the subroutine when it is required instead of incorporating it into the executable..
some compilers let you set options that will override the calling mechanisms shown above. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options(i.e thru DYNAM option in jcl) ....
Now, coming down to ur question, since C is modified and all the calls are static (considering the override not done thru jcl), the order of ur compile should be C followed by B followed by A.
However, if you override the static call thru jcl (by mentioning the DYNAM param), then the program u r overriding for need not be compiled - it will get so during the run-time.
Hope this helps... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Sree,
Excellent presentation. Just one disagreement:
Quote: |
The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes. |
Not always. If the CALLer is compiled as DYNAM, both CALL 'literal' and CALL variable result in a dynamic call. See below:
If CALLer is compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call
If CALLer is compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call |
|
Back to top |
|
|
sree_2503
New User
Joined: 22 May 2005 Posts: 12 Location: Chennai,India
|
|
|
|
Hi mmwife,
[quote]Not always. If the CALLer is compiled as DYNAM, both CALL 'literal' and CALL variable result in a dynamic call.
[/quote]
Yes, thats right, I think I mentioned that, but might be wasnt too explicit...
My quotes -
[quote]some compilers let you set options that will override the calling mechanisms shown above. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options(i.e thru DYNAM option in jcl) ....
[/quote]
Thanks |
|
Back to top |
|
|
jagadeesh.panicker
New User
Joined: 25 Aug 2006 Posts: 1 Location: trivandrum
|
|
Back to top |
|
|
|