View previous topic :: View next topic
|
Author |
Message |
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
Hi,
Is it possible to get the names of the called module using cobol batch/online loadlibs? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
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 |
|
|
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
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 |
|
|
|