Volume 7, Number 9 -- March 7, 2007

Three Little Words That Simplify Debugging

Published: March 7, 2007

by Susan Gantner

I had struggled with using the debugger in WDSc for a long time when I asked a friend that I knew to be an expert on the subject to help me understand how to use it. She told me that I only needed to know three little words--Service Entry Points--to make my debugging life easier. She was right!

If you have not yet learned the joys of debugging with Service Entry Points, try it today. In the Remote Systems view (RSE), choose a program object. Right click on the object and select Debug (Service Entry) --> Set Service Entry Point.

It can sometimes take several seconds for anything to happen, but eventually, you should see a confirmation message and the Service Entry Points view appears in the workbench. Your program name appears in the list of Service Entry Points. The default settings include *All modules in the program, *All procedures in the program and your User ID. See Figure 1 below.

(Click here to see a larger image)

Setting that Service Entry Point says that when this program is invoked by your user profile, the iSeries debugger within WDSC will ask you if you want to debug it. If you say yes (and/or if you have specified that there is no need to ask permission) the following will happen:

  • The debug view in WDSC will start (if necessary)
  • This program will be put into debug mode
  • The source for the program will be opened in the editor (if it's not already open)
  • The debugger will wait before the first executable statement for your interaction

Go to another job (e.g., an emulation session) and call the program and see this for yourself. It may take a while for the debug session to start up but when it does, you are ready to add any breakpoints you may need, set up fields you want to monitor values of as you are stepping through the program, issue a "Run to location" from a specific statement in the program or any of the other actions you may do within a WDSC debug session normally.

I think that's a pretty easy way to start a debug session. The best part is that it doesn't matter whether I want to run the program from an interactive session or submit it to batch. Even better, if this program were invoked in some "non-traditional" way, such as in a Web server job or a remote procedure call, I don't need to be concerned about figuring out what job needs to be debugged (or "serviced"). I can simply wait for the program to be invoked by my user profile wherever that is and it will go into debug mode for me.

Of course, you are not limited to debugging only programs that you personally call. You can right click on the Service Entry Point in the list and select "Modify" to change the user profile and/or to specify which module(s) and procedure(s) you want to debug. Notice that from the right click menu, you can also remove a Service Entry Point or temporarily disable it. You may also do these actions from the tool bar icons at the top left corner of the view, as shown in Figure 2 below. Another important option you can use here is to refresh the Service Entry Point. You will need to refresh any time the program is recompiled.

Sadly, nice as they are, Service Entry Points are not a panacea. There are some limitations. For some shops the biggest limitation may be that they only work for ILE language programs, i.e., RPGLE, CBLLE, etc. Another limitation, which may seem counter-intuitive, is that you cannot debug a program called from the RSE server job using a Service Entry Point. You cannot currently debug a program that is suspended due to an error--in other words, you cannot debug a program after it has already failed. And don't forget that you must refresh a Service Entry Point from RSE after the program has been recompiled.

You may want to check out the preferences related Service Entry Points. From the Windows pull down menu, expand Run/Debug, then select iSeries Debug. Here you will find the often important "Update production files" preference for all types of debugging and some specific preferences for Service Entry Points.

Hopefully these three little words will help to make your debugging life easier. Happy debugging.

Susan Gantner is one of the most respected System i gurus in the world and is one of the co-founders of System i Developer, an organization dedicated to RPG, DB2, and other relevant software technologies for the System i platform. Gantner, who has worked in IBM's Rochester and Toronto labs, left IBM to focus on training OS/400 and i5/OS shops on the latest programming technologies. She is a regular speaker at COMMON and other user groups, too. You can contact her at susan@SystemiDeveloper.com.

                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot

Sponsored By

Simplify the business of doing business

IBS INTEGRATOR opens up a world of
business possibilities. It's an IT solution that
can connect your company with
information from anywhere, in any format,
from legacy systems to new
business partners across the globe.

                                         · More than 250 powerful functions and features.
                                         · Supply chain integration with flexibility.
                                         · Powerful integration for all businesses.

Visit www.ibsus.com to learn more!

Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Bytware:  StandGuard Network Security 3.0, the next generation of System i security
COMMON:  Join us at the 2007 conference, April 29 May 3, in Anaheim, California
Profound Logic Software:  Experience RPGsp - the #1 iSeries Web development tool

IT Jungle Store Top Book Picks

The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95


The Four Hundred
What's IBM Cooking Up for RPG and the Web?

System i Marketeer Chats with iSociety Members

Midrange Boxes, Big Iron Drive Server Growth in Q4 2006

The X Factor: How Many Servers, How Much Juice, How Much Money?

The Linux Beacon
Red Hat Readies RHEL 5 for March 14 Launch

Novell Gets Pinched By Rising Costs, Falling Sales

Midrange Boxes, Big Iron Drive Server Growth in Q4 2006

The X Factor: How Many Servers, How Much Juice, How Much Money?

Four Hundred Stuff
VAI Says 'No Thanks' to the Quick Buck

nCipher Brings Key Management Software to i5/OS

Vision Taps SteelEye for Windows, Linux HA on iSeries

Business Objects Unveils Two BI Offerings for J.D. Edwards

Big Iron
DB2 for Mainframes Gets Native XML with V9.1 Release

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
March 3, 2007: Volume 9, Number 9

February 24, 2007: Volume 9, Number 8

February 17, 2007: Volume 9, Number 7

February 10, 2007: Volume 9, Number 6

February 3, 2007: Volume 9, Number 5

January 27, 2007: Volume 9, Number 4

The Windows Observer
Microsoft Competing Unfairly on Virtualization, VMware Says

Server Sales Up a Bit in 2006, But Q4 Looks a Bit Weak

Google Launches Business Applications

HP Buys Clustering Software Maker, Launches D2D Backup Solution

The Unix Guardian
Server Sales Up a Bit in 2006, But Q4 Looks a Bit Weak

HP's Unix Biz Is Flat in Fiscal Q1, Hurd Disappointed

Many Top Open Source Projects Still Lack Enterprise Support

The X Factor: How Many Servers, How Much Juice, How Much Money?

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar


The RPG & DB2 Summit

Multiple Display Files in One Program

Three Little Words That Simplify Debugging

Admin Alert: Better Subsystem Throughput Via Multiple Job Queues, Part Two

Four Hundred Guru


From the IT Jungle Forums
How to collect the object authorities in a PF

Printer override in CLP using QCMDEXC

How to install a network printer in the iSeries?

Referencing the key of current record

MCH5003 creating objects in library

Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement