• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Undocumented Debugger Function

    August 30, 2006 Hey, Ted

    Here’s a tip for those readers who, like me, still have to use the full-screen, green-screen debugger. I accidentally discovered that RPG supports a debugging option that is not documented in either the help text or the RPG programmer’s guide.

    If you want to break a program or procedure when a variable has a certain value, you can use a conditional breakpoint. In the following example, the program breaks at statement 12 if variable STATE has the value TX.

    break 12 when state = 'TX'
    

    Suppose you want to stop when part of a field contains a certain value? The debugger provides a substring function that can accomplish that task. Here’s the command to break if the fourth and fifth characters of ITEMNUMBER are G3.

    break 12 when %substr(ItemNumber 4 2) = 'G3'
    

    You can also use the substring function to look at part of a variable.

    eval %substr(ItemNumber 4 2)
    

    This is especially handy when you only want to see part of a long string. Also, you can change part of a character string.

    eval %substr(itemnumber 7 3) = 'ABC'
    

    It was an accident that I discovered that RPG supports substrings. The CL examples of conditional break points in the help text mention the %SUBSTR function, but the RPG examples do not, so I assumed that RPG did not support substringing. Then one day I forgot that %SUBSTR was only supported for CL and used it for RPG without thinking what I was doing.

    I wonder what other undocumented features the debugger might have.

    –Dominic Lefevre

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Midrange Dynamics North America

    With MDRapid, you can drastically reduce application downtime from hours to minutes. Deploying database changes quickly, even for multi-million and multi-billion record files, MDRapid is easy to integrate into day-to-day operations, allowing change and innovation to be continuous while reducing major business risks.

    Learn more.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Lakeview Technology:  A new standard for ease of use in iSeries High Availability
    Computer Keyes:  Rapidly convert *SCS printer files into black and white or full color PDF documents
    COMMON:  Join us at the Fall 2006 conference, September 17-21, in Miami Beach, Florida

    Federal Trade Commission to Weigh In on Net Neutrality Bang for the Buck: Enterprise i5 Servers Versus the Competition

    Leave a Reply Cancel reply

Volume 6, Number 32 -- August 30, 2006
THIS ISSUE SPONSORED BY:

T.L. Ashford
Asymex
COMMON

Table of Contents

  • Undocumented Debugger Function
  • EDTF and End-of-Line Delimiters, Take Two
  • Admin Alert: Four iSeries Access Tips for Windows Professionals

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle