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
 

 

Could we identify the called modules using loadlib?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
elixir1986

New User


Joined: 10 Nov 2015
Posts: 6
Location: USA

PostPosted: Fri Jul 14, 2017 1:53 am    Post subject: Could we identify the called modules using loadlib?
Reply with quote

Hi,

Is it possible to get the names of the called module using cobol batch/online loadlibs?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 14, 2017 2:06 am    Post subject:
Reply with quote

It is not possible to get all of them. Dynamic calls allow a COBOL program to use
Code:
CALL WS-PROG-VAR USING ...
where WS-PROG-VAR has the name of the program to call. This program does NOT have to be linked into the load module but may be a totally separate load module -- as long as it is available at run time (through the link list or STEPLIB). Hence without actually running the program, you have no idea that it is calling the program that is the value in WS-PROG-VAR.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1740
Location: NY,USA

PostPosted: Fri Jul 14, 2017 10:41 pm    Post subject:
Reply with quote

Quote:
Is it possible to get the names of the called module using cobol batch/online loadlibs?
Why is it required to get it from loadlib only or is just that you are curious to know with no real requirements ?
Back to top
View user's profile Send private message
elixir1986

New User


Joined: 10 Nov 2015
Posts: 6
Location: USA

PostPosted: Fri Jul 14, 2017 10:54 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Quote:
Is it possible to get the names of the called module using cobol batch/online loadlibs?
Why is it required to get it from loadlib only or is just that you are curious to know with no real requirements ?


This is a real time requirement to identify the cobol subroutines called by cobol programs.

There are many copybooks in each of the cobol programs, the copybooks have a potential to have call statements.
There are many copybooks in each of the subroutines, the copybooks again have a potential to have call statements.

The copybooks in turn have potential to have other copybooks in them and so on..

This mainframe system has been around for a long time now. There is no one very sure about how call statements were designed.(10000 cobol online/batch modules)

In addition, to make things complex, there are many modules where in the subroutines are inferred in the main program, subroutines and copybooks from files using occurs clause and/or move by reference.

Thanks for all responses!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 14, 2017 11:05 pm    Post subject:
Reply with quote

You can identify the CALL statements by doing a source scan for CALL. However, only by having a person examine the CALL statement can you tell if the subprogram can be known at compile time or not (that is, identified without running the program). For example, the following code would be perfectly valid:
Code:
ACCEPT WS-PROG-VAR.
CALL WS-PROG-VAR
so it is possible that parameters are being used to define which subprogram to call.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1740
Location: NY,USA

PostPosted: Sat Jul 15, 2017 1:39 am    Post subject:
Reply with quote

I have a REXX macro which will expand all the copybooks and the contents and it can be modified to expand the CALL Subprograms too but again you still got to do one main module at a time by a person.
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 Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 5 Tue Nov 29, 2016 9:25 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


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