Page 1 of 1

Cobol sub-program question.

Posted: Mon Jun 09, 2014 12:24 pm
by Anil Khanna
Hi,

Another question I've asked is: I have 100 subprogrames they are linked statically. I modify 90th and 95th sub-programs. Should I compile all the programs once again or I can just compile the 90 and 95th subprogram.

I answer only the 90, 95th and the main program should be compiled. Is this correct? If yes, can someone please explain more as I think it might be wrong as when programs are statically linked they will have a signle load module and compiling only the changed program will not link it any other sub-program (what if some sub-program is calling other sub-program). And if it is so, what's the benefir of having dynamic call? Can someone please explain in detail.

Re: Cobol sub-program question.

Posted: Mon Jun 09, 2014 5:55 pm
by enrico-sorichetti
Can someone please explain in detail.
unfortunately this is a HELP forum not a training one ...
furthermore no reason to rewrite what is clearly ( usually ) explained in the manuals
we will give suggestions and an overall explanation , up to you to meditate on the manuals for the details

as far as Your questions ...
the advantage of dynamic calls is that ( apart a small overhead when the subroutine7FUNCTION IS CALLED FOR THE FIRST TIME )
You will not have toRecompile the programs using it ( unless there is a change in passing the parameters.

the disadvantage is just an organizational one, IT WILL BE MORE DIFFICULT to track the subroutine usage.
( for static calls the source control package takes care of the tracking )

too bad that over the forums with IBM and mainframe in the name there is lots of confusion about compile ...
COMPILE is the process that given a source creates an OBJECT thingy
LINKAGE EDITOR ( LINK) is the process that takes OBJECTS thingies and builds an executable

so depending on the source control package , for static calls
the CHANGED SOURCES will be compiled
the program statically calling the changed subroutines might just be relinked
( but as I said all depends on the source control package customization )