Where is the source file of an ILE program?

135 pts.
Tags:
RPG
RPG ILE
RPG IV
RPGLE
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Cwc
    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,290 pointsBadges:
    report
  • Cwc
    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,290 pointsBadges:
    report
  • Teandy
    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,860 pointsBadges:
    report
  • Teandy
    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,860 pointsBadges:
    report
  • philpl1jb
    These methods will tell you where the member was when it was compiled but not where it is now. Phil
    51,355 pointsBadges:
    report
  • Teandy
    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,860 pointsBadges:
    report
  • CharlieBrowne
    He knows where the objects is but not necessarly the source. Souce could have been deleted or moved since object was created.
    41,380 pointsBadges:
    report
  • Ankita
    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..
    135 pointsBadges:
    report
  • Cwc
    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,290 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following