Call chain finding from load module



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

Call chain finding from load module

Postby Chaitnya » Fri Mar 13, 2009 5:27 pm

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
Chaitnya
 
Posts: 18
Joined: Wed Mar 26, 2008 1:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Call chain finding from load module

 

Re: Call chain finding from load module

Postby dick scherrer » Sat Mar 14, 2009 12:37 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Call chain finding from load module

Postby Chaitnya » Sat Mar 14, 2009 5:51 am

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
Chaitnya
 
Posts: 18
Joined: Wed Mar 26, 2008 1:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Call chain finding from load module

Postby dick scherrer » Sat Mar 14, 2009 7:02 am

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Call chain finding from load module

Postby Anuj Dhawan » Mon Apr 27, 2009 5:47 pm

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.
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post