125 pts.
 Where is the source file of an ILE program?
Hi,  I need to find out the name of the source file of a ILE program. I am getting a blank using DSPOBJD. I know it can be rtrieved using dsppgm but I need to run the process in a program and strore the output in a file.  Pls help... !! This is kinda urgent...  Thanks,  Ankita anki.nagpaul@gmail.com

Software/Hardware used:
rpg, as400, rpg IV
ASKED: December 9, 2009  8:00 AM
UPDATED: December 11, 2009  4:03 PM

Answer Wiki:
There is probably an easier way then this, but you can always do the DSPPGM to a print file, copy the spool file it creates to a physical file, then process that physical file to get the information you need. ==================================================== ILE programs don't have source files. ILE programs aren't created from source. ILE programs are created from *MODULE objects. Modules are created from source. An ILE program can have dozens of modules, so you might track back through dozens of source members and files. Different modules can be written in different languages. Any related source information will be associated with the module list from your ILE program. The *PGM object that you tried to display with DSPOBJD doesn't have the source info you were looking for. If you display the *MODULE objects, you'll see the source references. Tom
Last Wiki Answer Submitted:  December 9, 2009  8:53 pm  by  ElTerrifico   605 pts.
All Answer Wiki Contributors:  ElTerrifico   605 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Try the RTVOBJD command from within a CL program.

You’ll need to create variables for the SRCF parameter and any other information about the object that you want to retrieve.

DCL VAR(&SRCF) TYPE(*CHAR) LEN(10)

RTVOBJD SRCF(&SRCF)

After executing the command, the variable %SRCF should contain the source file.

For an ILE object, you’ll need to run the RTVOBJD command against the module object instead of the program object. This presents a problem though, because if the program was created with the CRTBNDRPG command, the module would not be available since it gets deleted once the program object is created from it. But if CRTPGM was used to create the program from the module, then the module object may still be around on your system.

 4,275 pts.

 

I found an API that should accomplish what you need. List ILE Program Information, QBNLPGMI should be able to retrieve the information you need, even if the module object is not available.

 4,275 pts.

 

Here is a link to a sample program that uses the API Cwc is talking about.

http://systeminetwork.com/node/60950

Also Bruce Vining wrote an article for MC press that might help called
Module, Module, Who’s Got My Module.

You can find it at:

 5,830 pts.

 

One of these days I am going to get the hang of this editor and be able to post links without having them disappear on me. Until then, here they are again:

Sample program:

http://systeminetwork.com/node/60950

Article by Bruce Vining:

http://www.mcpressonline.com/programming/apis/the-api-corner-module-module-whos-got-my-module.html

 5,830 pts.

 

These methods will tell you where the member was when it was compiled but not where it is now. Phil

 44,190 pts.

 

Since he has to have the object to use these methods, he already knows where it is. Is that not true or am I missing something?

 5,830 pts.

 

He knows where the objects is but not necessarly the source.
Souce could have been deleted or moved since object was created.

 32,905 pts.

 

hey.. Thanks for responding… First of all let me tell you I dont know about this API.
I tried to use the API that was mentioned but the code as per the code given in the links by Teandy. This always ends up in error “Library not found”. Dont know how to proceed further. Pls help..

 125 pts.

 

We will need some more details. Where are you seeing the ‘library not found’ error? Are you getting a compile error or at run time? If at run time, have you looked in the job log? The job log can be invaluable in tracing down things. And you may have to adapt the code to your specific usage and environment.

 4,275 pts.