Listing Source Change Dates for ILE Programs

Q. We have utilities that do a DSPOBJD to an output file. We then read this output file into a query specifically looking at the source file library, source file change date, and source file change time. This works on OPM programs but I cannot seem to get the same information on ILE programs. I’ve tried DSPOBJD and DSPPGM. Ideally I would want this information in an output file but if I have to do *PRINT and CPYSPLF I will. Do you know of any command that offers this for me? The most I’ve been able to come up with is program creation date; not source file change date.

A. Unlike OPM compilers, ILE compilers don’t create programs. Instead, they create *MODULE objects, which must subsequently be bound into *PGM objects. For an RPG IV program, the compiler command is CRTRPGMOD; the binder command is CRTPGM. If you use PDM option 14 to create an ILE program, the system combines these two commands into one, the CRTBNDRPG command. But both steps are still accomplished “under the covers.” CRTBNDRPG compiles the source, creating a temporary *MODULE object in QTEMP; it then binds that temporary module to a *PGM object, and deletes the temporary module.

So I would be at least partially correct in saying that ILE programs don’t have source. That’s why the source file and source date attributes are not part of an ILE program. You can, however, use DSPPGM to display the modules that make up a program; another command, DSPMOD, will then let you see the source file and change date for a module.

If you’ve used option 14 to create the program, however, the module is no longer there. So you won’t be able to reliably link the program to the source. This is one reason I recommend avoiding option 14. A better solution is to use PDM option 15 to create the module, then use the CRTPGM command to bind the module to a program. In this case, the module will remain on your system (unless you subsequently delete it).

This process is covered in more detail in my DVD packages, “RPG IV for RPG Programmers” and “RPG IV Modules, Procedures & Service Programs.”