Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

How can I display a variable?

I'm using an interactive debugger (STRISDB) and wanted to display the variable, i.e. X (Y Z). However, I received a message that this variable requires a basing pointer. I tried using the command, "Watch X (1 2)" but there is still an error in the command. How can I display the variable?
A Basing Pointer is a variable defined in your program that sets the address of the variable you are trying to watch. Look at the source code and see what the name of the variable is in the BASED D-spec keyword that will be associated with the field definition. That name is the name of the basing pointer.

If the pointer has not yet been set, you will get an error or a wildly inaccurate result.

If the variable or the pointer is defined in a subprocedure, trying to see the value outside of that procedure will give you an inaccurate result.

As for WATCH, try not to use it if you can use another method, since WATCH is system-wide (you can only have 16 Watches at a time in the whole machine!) and it is very hungry for system resources. Instead, look through the source and place breakpoints where the variable you are interested in changes.

Note: I tend to use STRDBG for interactive debugginging of ILE programs, and this behaves correctly with basing pointers. I do not know whether STRISDB behaves in the same way. If you are debugging non-ILE programs, there shouldn't be any pointer data types in them anyway. If you have problems with STRISDB and basing pointers in ILE programs use STRDBG instead.


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was last published in April 2005

Dig Deeper on iSeries application development tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.



  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...