• Subject: Error handling
  • From: keith mcintosh <keith_eh@xxxxxxxx>
  • Date: Fri, 14 Jul 2000 12:06:40 -0400 (EDT)

When handling errors in an RPG program is it better
to use the *PSSR with the SDS, or import the
_EXCP_MSGID? or is there really a difference? 
Besides the Number of lines of code!

Example 1.
 * ...
D ErrCPF      S         7    import('_EXCP_MSGID') 
 * ... the file keithm doesn't exist.
C            If  System('CLRPFM FILE(keithm)') <> 0  
C  ErrCPF    Dsply    
C            EndIf                                    



or Using Example 2.

 * ...
D PgmSts         SDS                
D  ErrTyp                40     42  
D  CPFNum                43     46      
 * ... the file keithm doesn't exist.
C             Eval  rc = System('CLRPFM FILE(keithm)')

 * ...
C   *PSSR     BegSR 
C             Eval ErrCPF = ErrTyp + CPFNum
C   ErrCPF    dsply  
C             EndSR


Thanks
K.

_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca
+---
| 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.