Is there a way (other than scanning the sources) to find out where a
given procedure is called?
Let's say I have a module M1 with 2 exported procedures (P1 and P2).
How could I find out which programs, services programs or modules
invoke P1?
Thx
Jack
Try using the QBNLPGMI API. According to the manual:
You can use the QBNLPGMI API to:
* List modules bound into an ILE program
* List service programs bound to an ILE program
* List data items exported to the activation group
* List data item imports that are resolved by weak
exports that were exported to the activation group
* List copyrights of an ILE program
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/apis/qbnlpgmi.htm
The parameter in which you specify the name of the ILE
program allows the special value *ALL as well as
generic values ('ABC*'), so you could in theory get
information on all the ILE programs in a library, or
even in all libraries - the library portion of the
parameter also allows *ALL - and write the information
to a file, or just manipulate it in your program that
calls the API.
Thx for the answer.
I found a sample of a program calling the QBNLPGMI API that works
fine. It gives the list of the modules invoked, but not the list of
the modules' procedures invoked in the program/service program. There
must be a place where the procedures invoked are stored, and a way to
get this information...
The List Module Information (QBNLMODI) API could be used to list module
imports (MODL0200 Format). Imported symbol type 0x00 indicates a procedure.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qbnlmodi.htm
Perhaps you could use one API to list modules, and then for each module
use QBNLMODI. Of course, even though a procedure may be
referenced/imported, that does not necessarily mean it is actually
called when the referencing module runs.
--
Karl Hanson