I am trying to retrieve a program statement/line number from the SDS, but whenever I look at the value of positions 21 - 28 -- whether it is before or after a dump -- all I get are zeros. What am I missing?
The second is that this field is ONLY filled when an error occurs in your program. The error information is placed into the Program Status Data Structure. The error must be an 'exception' type of error - that is, non-trivial; reading a file past an end-of-file condition will NOT generate an exception error (If you want that information you can get it from the file status data structure associated with the specific file).
Note that a DUMP operation is also not an error. You could force an exception-type error in your program by, for example, dividing by zero, but since you know which line the error is on, you don't need the PSDS to tell you!
There is the possibility that if your program is failing with an exception error and the statement number is zero, the error may well be occurring before any 'statements' are executed. Check the error message information in the PSDS in positions 40 - 46, and the routine in positions 29 - 36 (the value "*INIT" is a giveaway here).
For more information on the PSDS, click here.
And for the whole reference from which that was abstracted (the Websphere Development Studio ILE RPG Reference),click here..
MORE INFORMATION ON THIS TOPIC
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 iSeries ILE programming
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ... Continue Reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ... Continue Reading
RPGIV will 'think of' incoming integer fields as binary, and then will redefine them in the program structures as PACKED. So, when you chain a record... Continue Reading