Page 1 of 1

Call chain finding from load module

PostPosted: Fri Mar 13, 2009 5:27 pm
by Chaitnya
Hi All,

The load module contains the name of all called module in a particular COBOL code.

My question is can we trace down the call chain for a particular called module from the main load module, or is there any method to figure out the call chain.

Thanks,
Chaitnya

Re: Call chain finding from load module

PostPosted: Sat Mar 14, 2009 12:37 am
by dick scherrer
Hello,

Not from the load module.
The load module contains the name of all called module in a particular COBOL code.
Not necessarily. . .

If you have a good system programmer, they could find the info in a dump. In the lowest level module force an abend and the call chain should be in the resulting dump.

If you explain more about what you want to accomplish, someone may have a suggestion.

Re: Call chain finding from load module

PostPosted: Sat Mar 14, 2009 5:51 am
by Chaitnya
Hi Dick,

If you have a good system programmer, they could find the info in a dump. In the lowest level module force an abend and the call chain should be in the resulting dump.


I agree the dump has the call chain but it is the case when the job which run the cobol main module get abend.

If you explain more about what you want to accomplish, someone may have a suggestion


Yes, I have the source code and load module for all the program, say there is a main module progA. In progA there are two module called progB and progC. In progB again two module called as progD and progE and in progC one module called as progF. In progD there is one module called as progG. Now my requirement is that I know I have to analyze the progG in which my issue is resides and also know that the main module is progA. now I have to figure out the call chain as progA-->progB-->progD-->progG. As you said the call chain can be figure out from dump but here there is no dump with us as the job is not abend. So is there any way to figure out such call chain of all sub module with any method. I was thinking to have REXX for it but to code it we should know how can we achieve the thing. :)

I hope this clear my requirement. :idea:

Thanks,
Chaitnya

Re: Call chain finding from load module

PostPosted: Sat Mar 14, 2009 7:02 am
by dick scherrer
Hello,

So is there any way to figure out such call chain of all sub module with any method.
Not that i am aware of. Simply parsing all of the source looking for CALL statements might not be sufficient.

One issue are calls that do not use the form "CALL 'MODUL' USING. . .". The module might be called using a variable that is not set until execution. Another is that a module may have many calls, but there is no way to know which might be executed in a given execution. Something that once was somewhat common, but i see less of these days is a called module with multiple entry points. Even if the "called module" name is a constant, the source name may not be the same as the called name (not a good practive, imho, but has been done).

Re: Call chain finding from load module

PostPosted: Mon Apr 27, 2009 5:47 pm
by Anuj Dhawan
Two things come to mind:

1. Search the cbttape ( http://www.cbttape.org ) for samples of control block chasing.

2. Assuming that all the routines are higher-level language (or standard Assembler), the Save Area Trace gives the calling chain for programs. This works, however, only as long as standard calling sequence is used to set the forward and back pointers in the various save areas. And as long as the save areas are chained together properly, the sequence can be reconstructed without referencing anything else. And yes, assuming that when you say "call chain" you're referring to the calling sequence.