IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Utility to identify the subprograms called by a program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Mon Oct 15, 2007 3:00 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2007 6:36 pm
Reply with quote

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. . . icon_confused.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Mon Oct 15, 2007 6:40 pm
Reply with quote

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
View user's profile Send private message
sandy_venkat

New User


Joined: 16 May 2007
Posts: 35
Location: India

PostPosted: Mon Oct 15, 2007 8:45 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2007 8:59 pm
Reply with quote

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
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Tue Oct 16, 2007 10:41 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 16, 2007 12:38 pm
Reply with quote

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
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Thu Oct 18, 2007 1:01 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 18, 2007 6:06 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Thu Oct 18, 2007 8:40 pm
Reply with quote

If appreciated, I have a working sample...

post if You would like to see it posted
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Wed Oct 24, 2007 12:36 pm
Reply with quote

Hi E.S.

Please post ur Working sample, that would be of great help.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Wed Oct 24, 2007 2:06 pm
Reply with quote

I' ll post in the afternoon
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Sat Oct 27, 2007 9:59 pm
Reply with quote

Hi E.S,

You promised us to Post the Working sample by afternoon, please provide us the same.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Sun Oct 28, 2007 2:38 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 29, 2007 1:21 am
Reply with quote

Hi Enrico,

Thanks for posting your code icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts COBOL program logic for comparisipn o... COBOL Programming 2
No new posts Injecting HTTPHEADER parameters in th... PL/I & Assembler 0
No new posts Concurrent writing records to VSAM fr... JCL & VSAM 9
No new posts interactive cics program using CICS s... CICS 5
Search our Forums:

Back to Top