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

Could we identify the called modules using loadlib?


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

New User


Joined: 10 Nov 2015
Posts: 44
Location: USA

PostPosted: Fri Jul 14, 2017 1:53 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 14, 2017 2:06 am
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Jul 14, 2017 10:41 pm
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
Warnings : 1

New User


Joined: 10 Nov 2015
Posts: 44
Location: USA

PostPosted: Fri Jul 14, 2017 10:54 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 14, 2017 11:05 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Jul 15, 2017 1:39 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts Identify Program Insert DB2 7
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Identify unused (junk) REXX scripts TSO/ISPF 30
Search our Forums:

Back to Top