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

How do you read a formatted dump of an SQL RPGLE program?

How do you read a formatted dump of an SQL RPGLE program and what do you look for? For example, I received an error message on the console RX402R 6641 decimal-data error in field (C G S D F). I entered "D" to perform a dump. Were do I go from here?
On the first page of the dump you will see a line like this....

Statement in Error . . . . . . . . . . : 00010500

Open your source and go to that line (105.00 in the example above). In my source, the line is....

 0105.00 C                   Eval      test1 = test1 / test2 

Back at the dump, I search for TEST. I see the following lines....

TEST2               ZONED(4,0)               .            '40404040'X 
TEST3               CHAR(4)              '    '           '40404040'X 


TEST1                 INT(10)              1                '00000001'X 

Searching in my source, I find the problem.... 

0088.00 D                 DS                               
0089.00 D test2                   1      4S 0               
0090.00 D test3                   1      4    Inz(*Blank) 

I have been so silly! I have defined a blank field over the top of a numeric field.

Now, I am not usually so silly. But a decimal data error can come from such a thing, or from a failed record read where the record is defined in an uninitialized externally-described data structure, or by invalid data from a passed parameter -- there are several ways of getting bad numeric data. Now you know how to examine your dump along with the source, you should be able to work out the problem and find a solution.


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.

Dig Deeper on RPG iSeries programming