o you occasionally discover that source is missing for an object? Instead of determining that the source is missing when you need it immediately, you can get a regular report of all source members that are missing, and try to find them before they are permanently lost. It can be done with a few commands and Query/400.
Unless you actually compile new programs into production, a report will not be able to tell you if you have the correct source for an object. It will only report objects for which the source is missing.
The example I'll use is for RPG programs. You should repeat the process for every type of object you use, including other types of programs, commands, physical and logical files, and display files.
Start by creating a file of object descriptions for the program objects in the library. For example, for programs in library GLPGMS:
DSPOBJD OBJ(GLPGMS/*ALL) OBJTYPE(*PGM) OUTPUT(*OUTFILE) OUTFILE(mylib/pgmobj) MBROPT(*REPLACE)
When you use DSPOBJD for object type *PGM, you get all types of programs in the file. So, create a separate file with just the RPG objects.
CPYF FROMFILE(mylib/pgmobj) TOFILE(mylib/rpgobj) CRTFILE(*YES) INCREL((*IF ODOBAT *EQ 'RPG'))
Now that a file of RPG objects has been created, you need a file of RPG source members for comparison.
DSPFD FILE(GLPGMS/QRPGSRC) TYPE(*MBR) OUTFILE(mylib/rpgsrc)
Use Query/400 to create a report of objects that have no source.
Join the two files together, using an Unmatched Records (Type 3) join, with rpgobj (RPG objects) as the primary file and rpgsrc (RPG source members) as the secondary file. Use join fields:
T01.ODOBNM (Object Name) EQ T02.MBNAME (Member Name)
The records printed are those RPG program objects that do not have a source member with the same name in the RPG source file.
When using DSPOBJD to create the file of object descriptions and DSPFD to create the file of source members, ensure that you have sufficient authority to obtain information on all of the objects you need for reporting. The AS/400 will give you object descriptions and file descriptions only for objects to which you are authorized.
It is unlikely that you will be able to have access to the QSECOFR password every time you want to review the objects and source in a library. Instead, create commands and command-processing programs which adopt QSECOFR authority. Create new commands and command-processing programs called, for instance DSPALLOBJ and DSPALLFD. Have the security officer compile these new objects with USRPRF(*OWNER) and make the owner QSECOFR.
When you use the commands DSPALLOBJ and DSPALLFD, you can get information reported on all files and other objects in the requested library, but will not have permanent access to them.
Now that you have a report of objects without source, the real work is just beginning. As you follow up the items on the report, you will no doubt spend many hours scanning other source files in search of the lost source members, requesting restores from tapes archived on and off site, discovering the disappointment of media errors, and wishing that better production promotion procedures had been followed.
Maybe you will foresee how tedious the follow up work is and persuade someone else to do it. If you are stuck doing the follow up work yourself, you may even order change management software to prevent having to do this job ever again!