× 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: *PSSR subroutine and the call stack
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Mon, 10 May 99 15:15:07 +1000


Hello Paul,

Aaaarrrrggghjhhh, fffffffff....!  I should know better.  I wrote it without the 
manual handy.  
I forgot about RPG allowing resulting indicators on numeric operations (awful 
technique, up 
there with field indicators) -- although I shouldn't have, after all why are 
they also called 
+, -, and Z!  I picked DIV by zero because it is such an obvious error.

Alright.  Second bash.  The principle discussed is correct; the specific 
example is incorrect.  
Errors on arithmetic operations will pass control to the *PSSR if it exists.  
As you pointed 
out other operations support the technique I was illustrating:
        o File operations other than EXCEPT
        o ACQ, ADDDUR, CALL, CALLB, CHECK, CHECKR, COMMIT, DSPLY, EXTRCT, FREE, 
IN, OCCUR, 
OUT, REL, RESET, ROLBK, SCAN, SUBDUR, SUBST, TEST(D/T/Z), UNLOCK, XLATE

Have I redeemed myself?

Two children at Sunday School.  One says to the other, "We're studying 
Revelations.  What are 
you up to?"  The other one says. "Oh, our teacher says we're past redemption."

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
//--- forwarded letter -------------------------------------------------------
> X-Mailer: Mozilla 4.51 [en] (Win95; I)
> Date: Sun, 09 May 99 22:25:50 +0100
> From: "Paul Tuohy" <tuohyp@ibm.net>
> To: MIDRANGE-L@midrange.com
> Reply-To: MIDRANGE-L@midrange.com
> Subject: Re: *PSSR subroutine and the call stack

> Simon Coulter wrote:
> 
> > Hello Albert,
> > <<< snip >>>
> >  For instance, a
> > divide by zero operation is an error.  If you code it as:
> >         C               DIV     0       RESULT
> > this is an unmonitored exception and the RPG error handler causes an 
>inquiry message to be
> > sent.  If you code it as:
> >         C               DIV     0       RESULT                  --99--
> > you are using indicator 99 in the LO column to monitor for exceptions on 
>the DIV 
operation.
> > You can of course use %ERROR in more recent dialects of RPG IV.  If you 
>code it as in the
> > first example but also have a *PSSR in the program then you are performing 
>a global 
exception
> > monitor (like MONMSG CPF0000 in CL).
> 
>   <<<<snip>>>
> 
> Simon, correct me if I am wrong (no machine or manual handy) but I think that 
>the LO 
indicator on
> a DIV operation will signify that the result of the divide is less then zero, 
>not that an 
error
> has occured. Where as some of the non-file operation codes can have an error 
>indicator 
defined
> (CALL, IN etc.), I think DIV is the exception. In ye oldie days of RPG, prior 
>to structured
> operation codes, the resulting indicators were used on arithmetic operations 
>to signify that 
the
> result was <, > or  = to zero.
> 
> Regards
> 
> Paul Tuohy.

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.