Midrange News for the IBM i Community


Posted by: Chris Proctor
Programmer Analyst
Columbia Sports Company
Portland, OR
Finding actual error line in a procedure?
has no ratings.
Published: 30 Jul 2013
Revised: 30 Jul 2013 - 3923 days ago
Last viewed on: 26 Apr 2024 (4635 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Finding actual error line in a procedure? Published by: Chris Proctor on 30 Jul 2013 view comments(5)

Good morning. I remember reading somewhere on the web how you can set up your ILE RPG program to actually give you the error line number within a procedure instead of just the line number associated with the call to the procedure, but I can't find it anywhere.

Can someone please enlightment me?

Thanks!

Chris

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Finding actual error line in a procedure?
Posted: 10 years 8 months 28 days 9 hours 3 minutes ago

You're not thinking of OPTION(*SRCSTMT) on the Header Spec are you?

Posted by: chrisp
Premium member *
Portland, OR
Comment on: Finding actual error line in a procedure?
Posted: 10 years 8 months 28 days 8 hours 59 minutes ago

No, Bob. I have that in the H spec already. I have a dump that shows the error line number as the call to the procedure rather than the line number in the procedure where the "receiver too small to hold result" actually is.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Finding actual error line in a procedure?
Posted: 10 years 8 months 28 days 8 hours 27 minutes ago

Don't know. Sorry. You might try wrapping the entire body of the subproc implementation in a MONITOR/ON-ERROR rouitne. That may do it. Probably what's happening is the error is not being trapped inside the subproc so it causes the "call to the subproc ended in error" message to appear. If you try it, it'll still show up in the joblog, but not explode the call to the subproc.

Posted by: chrisp
Premium member *
Portland, OR
Comment on: Finding actual error line in a procedure?
Posted: 10 years 8 months 28 days 7 hours 59 minutes ago

That's exactly what it is. I just saw a way of coding the program so it gives the actual line number within the subproc, but I can't remember where it was! Urrggggghhh!! Lol.

If I find it, I'll be sure to post it. I'm sure others have run into the same problem. Thanks for the input, Bob!

Posted by: tdaly
Premium member *
Comment on: Finding actual error line in a procedure?
Posted: 10 years 8 months 28 days 2 hours 44 minutes ago
I think you might be able to do it with a condition handler.