TechTip - Analyze Your Programs and Applications, Part II - System Administration - IT Infrastructure
TechTip - Analyze Your Programs and Applications, Part II - System Administration - IT Infrastructure
HOME IT INFRASTRUCTURE SYSTEM ADMINISTRATION TECHTIP: ANALYZE YOUR PROGRAMS AND APPLICATIONS, PART II
TOOLS
PRINT EMAIL
The rst part of this article series showed how DSPOBJD can easily provide statistics to
manage a general recompilation project. But it only touched the surface of all the things you
get with the DSPxxx commands.
Let's start with a review of the information we gathered in Part I by just using DSPOBJD.
If we had used ODCCEN plus ODCDAT (i.e., the object creation date) instead of ODSRCC plus
ODSRCD, we'd have gotten a report on recompilation instead of a report on source update.
Figure 1: Here's the list of objects by type and year.
The code below counts programs (in fact, programs and modules, to also take care of ILE
objects) by compiler. Note that objects without source are eliminated by the WHERE clause.
There are two OPM programs in the libraries analyzed: one CLP and one RPG. But this analysis
doesn't show whether the ILE programs use the ILE default activation group or a speci c
activation group. This information is provided by DSPPGM, which does not offer an output le. In
the third part of this series, we will use the program description APIs for this information.
Sources in Library
The following SQL will reveal the number of instances of source code per library.
Old applications may have had their libraries of code renamed many times and can show traces
of these old libraries' names, so this list can be overwhelming. There are often names of libraries
that no longer exist. This does not mean that the source code is lost, but it would be wise to
check that the available source code has the same date indicated in the object.
Much less often than in the list per library, this list can show source le names that have
disappeared ... or should have disappeared.
Objects by Version
In a complex environment, it is common to have multiple machines with different version levels.
This analysis ensures that the application can be used on a machine that is not yet at the latest
version level.
Here, the objects are all compiled for V7.1. Installation on a machine running an older version will
require a recompilation. Sometimes, problems can appear if one or more programs use speci c
features of V7.1.
Note: In the case of JPLTOOLS, the question does not arise since I offer only the source code. And
the JPLTOOLS code is backward-compatible until V5.4.
Objects by Owner
Is management of the owners being done correctly? DSPOBJD gives no information on adoption
of rights. We will use the program description APIs for this information.
All the above information was obtained only by using the result of DSPOBJD. Now we will extend
our investigations to other commands. We'll use SQL to mix the results provided.
Obviously, this runs only for programs built with a module of same name. By doing this, I'll
arti cially create a link between the source member and the program. In fact, when context is
more complex than a source producing a module producing a program, I will need a true link
between these three elements. APIs provide this information . I will return to that point later.
DSPFD FILE(JPLTOOLS/*ALL)
TYPE(*MBRLIST) OUTPUT(*OUTFILE) FILEATR(*PF)
OUTFILE(JPLTOOLS/MBRLIST)
OK, but this list contains members of all les: PF-DTA and PF-SRC.
To keep only the membership list of source les, retrieve the attributes of all les:
OUTFILE(JPLTOOLS/FD_ATR)
Reminder: DSPOBJD gives us the exact date of the source code when compiling the module.
DSPFD MBRLIST gives us the exact date of last modi cation of the source code.
The next step is to simplify reading of DSPFD-MBRLIST. For the modi cation date of the source
code, use this code:
SELECT MLNAME, case when MLCHGc = '' then ' ' else trim(char( MLCHGC+
19)) concat MLCHGD concat '-' concat MLCHGt end Upddate,MLMTXT FROM
jpltools.mbrlist WHERE MLCHGc <> ''