Problem solve Get help with specific problems with your technologies, process and projects.

How to read the formatted dump of an RPGIII Program.

I am just learning the AS/400 and RPG. How do you read a formatted dump of an RPGIII Program and what do you look...

for? Example: I received an error message on the concole RX402R 6641 decimal-data error in field (C G S D F). I enter "D" to get a dump. Where do I start to find the problem?

What the "dump" shows you are the files that are opened, the record they are pointing to, and the value in each of the fields. All "dumps" are stored in output queue "QEZDEBUG". If you type WRKOUTQ QEZDEBUG you will see all the different spool files that were created when a program failed.

When you receive a decimal data error, the program either placed non-numeric data into a numeric field or the field was never initialized before it was accessed. If you look through the spool file, you will see "Invalid data" listed for the value of a numeric field. The dump will also tell you at what line of the program the error occurred. Look inside your program at the line and see which of the fields are in error.

Decimal data errors are one of the most common errors to receive in RPG. Here are a few hints to help to ensure they don't happen.

1. Before dividing two fields, make sure factor two is not equal to zero.

2. If defining numeric fields in the "I" spec, place an "I" in column 8 so the field is initialized at the start of the program.
I I 0 B 1 40NUBMQ

3. If defining numeric fields in a multiple occurrence data structure, initialize all the fields.
I 1 20 TST1
I 21 30 TST2
I 31 350TST3
C* C** Clear the initial Test array
C 1 DO 100 X
C Z-ADD1 X 30

I hope this helps, and you can find the error within the program. The dump can be several pages long, but in there is the one piece of information you need. Take some time and read the dump, you will find all kinds of useful information on what the program was doing at the time it failed. Remember that by knowing the statement the program failed on, you can run it in debug and see were the problem is before the fail actually happens.

This was last published in March 2001

Dig Deeper on RPG iSeries programming

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 ...