• 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
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Watch Now

    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

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • 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

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