Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Utility to identify the subprograms called by a program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Utility to identify the subprograms called by a program
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

Site Director


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

PostPosted: Mon Oct 15, 2007 6:36 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Oct 15, 2007 6:40 pm    Post subject: Reply to: any utility to identify the subprograms called by
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    Post subject:
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

Site Director


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

PostPosted: Mon Oct 15, 2007 8:59 pm    Post subject: Reply to: any utility to identify the subprograms called by
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Tue Oct 16, 2007 12:38 pm    Post subject:
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: 149
Location: Ottawa Canada

PostPosted: Thu Oct 18, 2007 1:01 am    Post subject:
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

Site Director


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

PostPosted: Thu Oct 18, 2007 6:06 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Oct 18, 2007 8:40 pm    Post subject: Reply to: Utility to identify the subprograms called by a pr
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Oct 24, 2007 2:06 pm    Post subject: Reply to: Utility to identify the subprograms called by a pr
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Sun Oct 28, 2007 2:38 pm    Post subject: Reply to: Utility to identify the subprograms called by a pr
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

Site Director


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

PostPosted: Mon Oct 29, 2007 1:21 am    Post subject: Reply to: Utility to identify the subprograms called by a pr
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us