Static calls and recompilation



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Static calls and recompilation

Postby sinmani » Fri Mar 23, 2012 5:51 pm

A –>B->C->D->E all are calling each other with static calls.If we have changes in program C. Whats else needs to be done to run the software?
which programs need to be recompiled??
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Static calls and recompilation

Postby BillyBoyo » Fri Mar 23, 2012 5:52 pm

You only need to recompile what has changed. Program C. The linker/binder takes care of the rest.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Static calls and recompilation

Postby Robert Sample » Fri Mar 23, 2012 6:31 pm

You would HAVE to recompile program C. Depending upon what changed, you may have to recompile A, B, D, and / or E. In all cases, however, you would have to redo the linkage editor / binder step to rebuild the load module using the new version of program C -- if that is how the load module was built in the first place. Note that a static or dynamic COBOL call does not necessarily mean the load module includes the subroutine (which depends upon how the linkage edit / binding was done). If A, B, C, D, and E are separate load modules, then recompiling program C would be sufficient. If they are not separate load modules, then whichever load modules included program C would have to be relinked (rebound).
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Static calls and recompilation

Postby sinmani » Fri Mar 23, 2012 8:44 pm

@Robert thanks for your reply.
By what u have said you mean it is not necessary that subroutine be a part of the load even in case of static calls.
On the other hand what I have read is that in case of static calls the subroutines are a part of the load and are hence faster. This is their advantage.

While in case of dynamic calls the whether subroutine is loaded or not is decided at run time. Hence they are slower but use less memory.
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Static calls and recompilation

Postby Robert Sample » Fri Mar 23, 2012 11:42 pm

COBOL separates static / dynamic, remember. A CALL 'program' can be static or dynamic, depending upon the compiler options. A CALL variable-name will be dynamic. But I have seen programs with dynamic COBOL CALL statements where the subprogram is linked into the load module.

Dynamic calls allow for smaller overall load modules since each calling program does not need a copy of every subprogram it calls -- but the overall size difference depends upon the system and how many programs call how many subprograms. If program A calls program B calls program C, and these 3 programs aren't used anywhere else, then the load module size compiling A, B, C into one module may well be smaller than having 3 load modules. Plus there is run-time overhead of fetching each load module into memory.

The big advantage to dynamic calls is that each subprogram can be maintained without having to recompile a batch of calling programs for every change made to the subprogram. Talking about "faster" or "less memory" is completely missing the point -- the savings in people time in not having to track which modules need recompiling just because subprogram X changed vastly outweighs execution considerations.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Static calls and recompilation

Postby sinmani » Wed Apr 04, 2012 10:11 am

Thanks Robert, This is very informative :)
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: Static calls and recompilation

Postby Deepak kumar25 » Sun Apr 22, 2012 12:43 pm

DYNAMIC CALL IS BETTER BEACUSE YOU DO NOT NEED TO RELINK YOUR APPLICATION IF YOU CHANGE SOMETHING IN YOUR SUBROUTINE,
ONLY SUBROUTINE DLL NEEDS TO BE RELINKED
THE BENIFITS OF DYNAMIC CALLED SUBROUTINE IS THAT U CAN FREE MEMORY THAT A DYNAMICALLY CALLED SUBROUTINE BY CANCELING SUBROUTINE.
Deepak kumar25
 
Posts: 34
Joined: Mon Jan 10, 2011 10:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: Static calls and recompilation

Postby BillyBoyo » Sun Apr 22, 2012 12:48 pm

Firstly, please don't type in all caps, it is considered to be "shouting" and rude.

It is not that common for a DLL to be produced on a Mainframe,

Is that the only benefit you can come up with? Any downside?

What are you trying to do with these resurrections of old topics?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Static calls and recompilation

Postby Deepak kumar25 » Sun Apr 22, 2012 1:27 pm

ok billy , i will always type in small,
yar these are not old topics, these are alive.




deepak kumar
mainframe trainer(applied labs)
Deepak kumar25
 
Posts: 34
Joined: Mon Jan 10, 2011 10:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: Static calls and recompilation

Postby BillyBoyo » Sun Apr 22, 2012 2:28 pm

Re: Static calls and recompilation

Postby sinmani » Wed Apr 04, 2012 4:41 am
Thanks Robert, This is very informative :)


sinmani started the topic, and seems to feel the information provided satisfies their need.

So, why resurrect it?

Why resurrect it with such pointless rubbish?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post