by Paul H. Harkins
Demo Booth provides a practical, technical look at application development and system
management/operation tools. In Demo Booth, software vendors provide concise, concrete explanations of how their products can solve
common iSeries problems. The vendors speak for themselves iSeries NEWS editors referee submissions to eliminate promotional material
and to edit for style and clarity but vendors select their own problems, solutions, and presentation approach.
IBM's Deep Blue computer project quickly overwhelmed the world's top chess master by harnessing the amazing power of the computer
(the computer worked so fast that it could try virtually all possible moves before selecting the right one) to "outsmart" the
grandmaster at his own game. Using raw speed rather than rarefied intelligence was a new way of thinking and of playing chess. Harkins
Audit Software, Ltd.'s Real-Time Program Audit for RPG (RTPA) software utility uses the computer's power to increase RPG
programmer productivity. RTPA shows the programmer every line of source code as it executes, including all the data being processed,
in realtime, thereby eliminating the need for "what-if" analyses (e.g., "What if this happened? What if the data was that?") and the
flat-out guessing that consumes so much programming time, talent, and money. A companion software utility, RTPA for CLP (Control
Language Program) provides similar auditing for CLP source statements and declared variables in realtime as CLP programs
To enable RPG source programs for auditing, RPG III and RPG IV programmers use RTPA audit options to expand a copy of a source
program. In the expanded source program, programmers can audit every source line of code as it executes or selectively audit any
combination of files, records, operation codes, subroutines, and variables in the program. RTPA audit output shows the source as it
executes and shows the data directly under the variable in the source code. Programmers can quickly focus the RTPA audits on what
they want to see or understand about the source code that is actually being executed in a program, and on what they want to see
or understand about the data the program is processing. In addition, programmers can audit only the program source actually executed and
the data processed for selected warehouses, packers, customers, order numbers, or range of invoices (or almost any other program
condition) in a job that processes thousands or millions of records.
Real-Time Program Audit for RPG (RTPA)
Software tool to help programmers analyze and fix code
The sidebar "RTPA Installation and Set Up" tells you how to install and configure RTPA.
To begin using RTPA, enter command RTPA, which brings up the Expand RPG Source Program with Audit Statements screen that
shows. Next, select an RPG III or RPG IV program to expand
with RTPA audit statements. You can type the program name or select it from Programming Development Manager (PDM).
In the example that
shows, I've selected the RPG IV sample source program NEWEXPSH in file QRPGLESRC in library Z$AUDIT for auditing. RTPA places the
expanded object program in library Z$AUDITE. (Note: Programmers each have their own RTPA user profile and RTPA audit profile, thus
letting them each set the RTPA default options for their specific needs for example, to specify RPG III or RPG IV as the default
RTPA uses audit profile NEW PROGRA to display the default auditing options for a new program. The default auditing options
audit every executable source statement in the program, show the data for all variables, and print one line of data for each file
record processed. To insert RTPA audits (with the displayed audit defaults) into a copy of the source program, use the Express from
defaults option (F10). Use the Customize option (F11), to focus the auditing by selecting which files, records, operations, subroutines,
or variables you want to audit. You can also specify conditions to start or stop auditing based on the data being processed.
Use the Status option (F18) to view the audit details screen, which
shows. This screen displays a one-line summary for each RTPA
source program expansion. Status 8 Expand RPG Compiled OK means that RTPA successfully inserted audit statements into a copy of the
source program, the expanded source program compiled successfully, and RTPA created the object program in library Z$AUDITE. The
expanded object program is now ready for testing. Place library Z$AUDITE ahead of the library containing the existing object
program, then use your usual testing procedures for the program or application to audit the program execution and the data being
processed by this expanded object program.
RTPA outputs the audit of the program execution to printer file Z$AUDITP, which
shows. RTPA creates this audit print file in realtime, as the
program executes, and the file shows the source lines of code as they are executed and the data that is being processed.
The RTPA audit output in
shows that compile listing statement 229 is an EXFMT to file
GETEXPD1, and the next line is the actual data passed from the display file into the program, starting with the indicators, then
the screen data fields. Statement 248 is the chain to record odetrec with the key list ordkey, and the next line is the contents of
ordkey, which is 000150000001. Statements 249 and 252 show RTPA's ability to preaudit conditional statements. In this example, the
chain of the order detail record was found.
shows, RTPA's output lets you see exactly what the program is
doing, and you can review the audit output at your convenience, rather than being able to view it only in realtime. RTPA lets you
observe exactly what a program is doing, including all statements and data executing in that program and in related programs calling
the program and being called by the program in realtime, and therefore in time-stamped sequence.
For more information about RTPA, see the sidebar "Product Information, below."
RTPA Installation and Setup
Installing, setting up, and configuring Real-Time Program Audit for RPG (RTPA) usually takes 15 minutes or less.
- RTPA licensed code CD-ROM and the RTPA for RPG User's Guide
- Access to an iSeries computer optical reader (usually device OPT01)
- QSECOFR password
- Approximately 60 MB of available iSeries disk space
- Sign on as QSECOFR.
- Put the RTPA for RPG licensed code CD-ROM in the iSeries optical reader.
- Use the RSTLIB command to restore the following RTPA libraries from the RTPA CD-ROM to the iSeries. The command
is RSTLIB then command key 4 to prompt.
- RSTLIB SAVLIB(Z$AUDIT) DEV(OPT01) MBROPT(*ALL) ALWOBJDIF *ALL FRCOBJCVN(*YES)
- RSTLIB SAVLIB(Z$AUDITE) DEV(OPT01) MBROPT(*ALL) ALWOBJDIF *ALL FRCOBJCVN(*YES)
- Call Z$AUDIT/RTPAUSRPRF to create the RTPA user profile and job description, to grant object authority QPGMR and
*PUBLIC to all objects in libraries Z$AUDIT and Z$AUDITE, and to copy the RTPA command RTPALIBL from library Z$AUDIT
to library QGPL.
- Sign off QSECOFR.
- Remove the RTPA for RPG CD-ROM from the iSeries optical reader.
After you've performed the preceding steps, installation, set up, and configuration are complete. Next:
- Sign on as RTPA, password RTPA.
- Use the RTPA command RTPALIBL ADD to add the RTPA libraries Z$AUDITE and Z$AUDIT directly after library QTEMP
in the programmers library list.
To verify successful installation, run the sample RTPA programs in library Z$AUDIT.