Problem solve Get help with specific problems with your technologies, process and projects.

Utility helps you trace RPGLE programs

Need to trace an RPGLE program? Forget F10=Setup. Try this utility instead.

Recently I had to trace RPGLE program and then I realize that there is no real option to do that.

For the ADDTRC (Add Trace) Command I found in the manual that
"This command cannot be used to trace bound programs" (what a pity...)

Well, on that occasion I used the F10=Step until I got a blister in my finger...

I looked around and I found a full set of APIs for debugging.

I decided to write a simple trace utility and share it with the rest of the community.

The full source set includes the following:

Source file.Member

Type

Description

Note

QCLSRC.TRCINS

CLP

TRACEIT install

After you upload all the sources to your library use this program to compile.
The objects are created in QTEMP So you will have to move the objects to your final library.

QDDSSRC.GEDDS99

PF

Template for data structures

 

QDDSSRC.TRACEIT

PF

The output from the trace

 

QRPGSRC.TRC002M01

RPGLE - Module

Session Handler

 

QRPGSRC.TRC004M01

RPGLE - Module

Program-Stop Handler

 

QRPGSRC.TRC010M01

RPGLE - Module

Parameter carrier

 

QRPGSRC.TRC012M01

RPGLE - Module

Common sub procedures

 

QRPGSRC.TRC010M00

RPGLE

Prototypes source

No compile needed

QRPGSRC.TRC012M00

RPGLE

Prototypes source

No compile needed

QRPGSRC.TRC010

SRVPGM

Parameter carrier

The source contain the parameters for the CRTSRVPGM Command

QRPGSRC.TRC002

PGM

Session Handler.
This program is specified in the SRCDBGPGM parameter of the Start Debug (STRDBG) command.

The source contain the parameters for the CRTPGM Command

QRPGSRC.TRC004

PGM

Program-Stop Handler.
This program records the program statements to file QTEMP/TRACEIT

The source contain the parameters for the CRTPGM Command

QCMDSRC.TRACEIT

CMD

Front End for the trace utility

 

QCLSRC.TRACEIT

CLP

CPP (command processing program) for the TRACEIT command

 

 

Using TRACEIT

  1. Make sure your program is compiled with DBGVIEW(*SOURCE).
    also use OPTION(*NODEBUGIO) for performance boost.
  2. Use command TRACEIT (Use the command prompter).
  3. Run your program.
  4. Use ENDDBG (End Debug) this is important so QTEMP/TRACEIT will be complete.
  5. Check the content of file QTEMP/TRACEIT.

Final note

  • This utility was developed on V4R4M0 machine.
  • This utility is quite recent which means that it might contains some hidden bugs. (Beware...).
  • At the moment this utility works only with programs where the entry module name euals the program name (CRTPGM ENTMOD(*PGM) or using the CRTBNDRPG Command). I hope to add moe code to fix that in a later version.
  • This utility was designed for RPG IV programs.

Happy tracing


Dig Deeper on iSeries CL programming

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

Eitan hi, hope you are doing well. Have you taken this tool beyond a single program? Thanks, Praveen
Cancel

-ADS BY GOOGLE

SearchDataCenter

Close