× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Trapping errors with CALLP?
  • From: PARKIB@xxxxxxxxxx
  • Date: Tue, 4 Jan 2000 11:18:51 +0000



David wrote:

> CALLP(E)  and check %error
>
> I've run into a problem using CALLP ... I can't trap errors.

> I forgot to mention ... I'm compiling to V3R2 :(

In common with all the RPG IV free-format opcodes, (EVAL, CALLP, IF, DOW, DOU,
SELECT) CALLP has no Resulting Indicators available.  In particular, the Lo
indicator - often used for trapping error conditions - cannnot be coded.  (This
is not unusual.  There are many fixed-format opcodes such as MOVE, MOVEL, etc
which also have no error indicator.)

Those opcodes which DO have error indicator capability can now (V4R2) take
advantage of the E-extender syntax, e.g. READ (E).  The E-extender may be coded
for the CALLP opcode - but not for any of the other free-format opcodes.

None of this information is of any use at V3R2!!  So, may I suggest an
alternative strategy.

Consider using the ILE Condition Handling facilities, in particular the CEEHDLR
and CEEHDLU API's.  These allow you to construct an error handling routine and
"activate" it in your main code where desired.  This routine would be ideally
suited to placement in a Service program.

Such an error handling routine can be used to trap errors from ALL opcodes where
an error indicator is not available (or not coded).  So, the bulk of your error
handling can be moved outside the main application logic.

Within your error handler, you can decide whether or not the error can be dealt
with, and what action to be taken, (e.g. resume execution at the next
statement).

I recommend you review the relevant sections in the RPG IV Programmer's Guide,
ILE Concepts, and System API's manuals.

Hope this information is useful!

(Who knows, in time we may see the E-extender extended to other opcodes, or RPG
IV acquire additional error handling capabilities (Direct Monitors ?).  Of
course, none of this helps at V3R2 - so take a look at ILE Condition Handling.)


Brian Parkins, AS/400 Instructor, IBM Learning Services (UK)
e-mail: brian_parkins@uk.ibm.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.