TechTip: More Source Debugger Facts

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times
Since the previous debugger tip was received so well, I searched for some more useful information to share with you. With a little help from some readers who were having troubles, I found some more facts. While this list is probably not as little-known as the previous tip's list, these are still some important facts to have when you're trying to debug a program.

The DEBUG Keyword

The more well-known function of the DEBUG keyword, as used in an H-spec, is to control whether DUMP operations are performed or not. But the other function that the DEBUG keyword controls is whether or not unused fields from externally described files are moved from the file buffer. You may be asking yourself what this has to do with debugging. The answer is that if fields are not moved from the buffer, the values are not available during debugging. For instance, if you're using DEBUG(*NO), which is the default, then only fields that are referred to in the program code will be accessible when you're debugging. Contrariwise, if you use DEBUG(*YES), all the file fields will be accessible, regardless of whether they are referred to in the code.

Compiler OPTION Keyword

For now, we will speak specifically about using CRTBNDRPG or CRTRPGMOD. Several keywords used in these commands control debugging options. First, the OPTION keyword can be used to control whether breakpoints are generated for input and output specifications by using *DEBUGIO or *NODEBUGIO. I have found that using *DEBUGIO to generate breakpoints for I/O specifications is rarely useful, so I always use *NODEBUGIO.

Compiler OPTIMIZE Keyword

Again, you might ask what the OPTIMIZE keyword has to do with debugging. The answer is that the level of optimization affects whether variables can be modified and/or whether the displayed values are the current values. Using OPTIMIZE(*BASIC) will allow variables to be displayed but not modified in debug mode. While using OPTIMIZE(*FULL), variables cannot be modified, and values displayed for interrogated variables may not reflect the current values.

Compiler DBGVIEW Keyword

This is perhaps the most well-known of the compiler keywords that affect debugging. There are six options, and there's not room here to cover all of them. So I recommend that you check the iSeries Information Center and find out the details for yourself. For my part, I always use DBGVIEW(*ALL).

Also, when compiling an RPG ILE program that uses SQL (using CRTSQLRPG), there are only two options, either *SOURCE or *NONE. The functioning of *NONE should be clear enough. However, using the *SOURCE option will cause DBGVIEW(*ALL) to be used in the subsequent CRTRPGMOD and/or CRTBNDRPG commands.

Happy hunting.

Jeff Olen is an analyst in the IS department at Costco Wholesale in Issaquah, Washington (just outside Seattle). He has nearly 20 years of experience on midrange systems and has developed software for a wide range of applications. He may be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

Jeff Olen

Jeff Olen is a super-spy now but keeps his cover identity intact by working for video game studios on the East Coast. So when he’s not out killing members of ISIS or rescuing refugees, you can find him playing Wolfenstein II or testing the new Fallout 76 releases at his beach house in Costa Rica. In any case, he can’t be reached. You can email his cat at This email address is being protected from spambots. You need JavaScript enabled to view it.. She will pass on your message…if she feels like it.


MC Press books written by Jeff Olen available now on the MC Press Bookstore.

The IBM i Programmer’s Guide to PHP The IBM i Programmer’s Guide to PHP
Get the scoop on how PHP can—and should—be deployed on IBM systems.
List Price $79.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: