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
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.
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.
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:
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
These methods will tell you where the member was when it was compiled but not where it is now. Phil
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?
He knows where the objects is but not necessarly the source.
Souce could have been deleted or moved since object was created.
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..
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.