Home > AS/400 Tips > iSeries programmer tips > Utility helps you trace RPGLE programs
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Utility helps you trace RPGLE programs


Eitan Rosenberg
03.06.2003
Rating: -3.58- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

RPG III & IV
The call of the prototype
The Lazy Coder: Get the bugs out
Why service programs need binding source
The truth about indicators
Revisit your database naming conventions
The ins and outs of *INLR
Working with APIs and user spaces
BIFs simplify numeric to alpha conversions
RPG programming tips & tricks
Top 10 programmer tips

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts