View previous topic :: View next topic
|
Author |
Message |
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Hi,
Can anyone help?
I have a main program and this program calls some sub programs.can anyone tell me if there is any utility to list all the programs that have been called by that program.(because some programs are called from an input file) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
can anyone tell me if there is any utility to list all the programs that have been called by that program |
You can search the source for CALL statements. Keep in mind that CALLs can be made from either a variable or a literal name for the called module.
Quote: |
(because some programs are called from an input file) |
Please clarify what this means. Programs are called by programs - i don't know how to call programs from input files. . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
If You have a development control tool like ENDEVOR or SCLM there should
( I know for sure the capability exists for SCLM ) a cross referencing utility
at least for static calls |
|
Back to top |
|
|
sandy_venkat
New User
Joined: 16 May 2007 Posts: 35 Location: India
|
|
|
|
dick,
i guess he means by "calling from input files", that the input file contains some kinda parameters that hold the names of programs and that this file is used in the program. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Sandy,
Quote: |
the input file contains some kinda parameters that hold the names of programs |
Could be. . .
Kinda scary though, if the file contains a non-existant module name, it will generate an abend when called.
d |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
hi..
iam sorry for a very late reply..
ya sandy..i have the same situation..
so i just want to know if there is any utility so that i can know the different programs that are being called when this program is executed. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
shchan,
for table driven systems using dynamic calls, I found that I had to insert a routine in every module in the system, that would be performed during the 'housekeeping' phase of each module. This routine would CALL a utility module (which i wrote). This utility module would enter the calling modules name into a table (to keep track of number of times the module was called - no, not the utilitiy module) and optionally would 'DISPLAY' for batch or TDS queue write for cics the module's name. (The TDS queue was actually a flat file which could be printed/viewed later.) This enabled my developers to follow the 'dynamic calls'; discover loops, etc...
obviously, you need to insure what ever is feeding the 'CALLing mechanism', contains modules that exist and are 'invokable'. As far as I know, there is nothing that details (writes a listing) of modules dynamically called in a task. I would not think that you want to be trying to walk up and down the TCBs, and there is no need.
I prefer the CALLed module reporting as apposed to the CALLing module reporting method. If every module has a routine that is performed when it is initially invoked, you can make it a procedural copybook, which would be a part of the standard boilerplate for a new module. Otherwise you need to insure that before each CALL, in every program, there is a display, ugh! You can also control the behaviour of the 'utility program' to display everything or just new calls - thus limiting the list to only those modules called and not everytime the module is called. |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
Some fellow where I work wrote COBOL parsers to scan the source code and pick out the CALLs and LINKs and XCTLs and other interesting stuff. Almost all our calls are dynamic yet he did a fine job of hunting down the program names.
I would suggest using REXX since its parsing ability is so great... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi TG,
That would work well for many situations.
What shchan is working with receives program names as data at run-time and then does a dynamic call to the program(s) specified. There is nothing in the source to "track". New callable modules can be added without any change to the source (if i understand correctly). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
If appreciated, I have a working sample...
post if You would like to see it posted |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hi E.S.
Please post ur Working sample, that would be of great help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I' ll post in the afternoon |
|
Back to top |
|
|
rajaherein
New User
Joined: 11 Jan 2007 Posts: 23 Location: chennai
|
|
|
|
Hi E.S,
You promised us to Post the Working sample by afternoon, please provide us the same. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
here is the callxref rexx script
just create a pds called anyname You want,
put three members in it..
1) reswords
2) xref
3 xrefjcl
try and post if You have any questions |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Enrico,
Thanks for posting your code
d |
|
Back to top |
|
|
|