× 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: ILE error message handling
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 07 Mar 01 09:47:46 +1100


Hello Jade,

You wrote:
>Okay, how can I get this same type of thing to take place in the ILE world.
>I've tried all sorts of combinations to percolate the message, but it just
>doesn't work the way it use to.  Since this is the 'new way' of doing
>things, maybe I'm wrong to want it to work the way it used to.

You can't get it to behave exactly like it used to but you can get close.  
The main reason things behave differently in ILE is due to each procedure 
having its own call stack entry and therefore its own message queue.  Think 
of each procedure as a mini-program.  Percolation should result in the 
message arriving at the main module as an unmonitored message and thus 
invoking any *PSSR.  This behaviour can change with service programs and 
activation groups.

>I've looked in the archives, but I haven't had much luck finding the
>information I need.  Can anyone give me some direction as to what I'm
>missing?  Good 'ol PSSR just doesn't cut it anymore.

The two most obvious possible approaches are:

1/ Add a *PSSR to each procedure.  The *PSSR as described in your original 
note sounds pretty standard so a /copy could be used to include it.

2/ Put a *PSSR in the main executable programs -- don't worry about service 
programs.  Send all your exception messages to the entry procedure which is 
the name of the module prefixed with '_QRNP_PEP_'.  You can get the module 
name from the *PROC value of the Program Status Data Structure.

Hopefully the following trivial example will help.  It avoids the issues of 
percolation by simply sending all exceptions to a known program queue.

The example invokes proc1 which invokes proc2 which invokes proc3.  Proc3 
has a problem and sends an escape message.  The *PSSR catches the error and 
handles it -- in this case just by displaying the fact that it was invoked.  
You may wish to add code to remove the function check or forward the message 
on using the QMHMOVPM API.

H DFTACTGRP(*NO) ACTGRP(*CALLER)                               
D QmhSndPgmMsg    PR                                           
D                                     EXTPGM('QMHSNDPM')       
D  msgId                         7    CONST                    
D  qualMsgF                     20    CONST                    
D  msgDta                    32767    CONST OPTIONS(*VARSIZE)  
D  msgDtaLen                    10I 0 CONST                    
D  msgType                      10    CONST                    
D  callStkEnt                 4096    CONST OPTIONS(*VARSIZE)  
D  callStkCnt                   10I 0 CONST                    
D  msgKey                        4                             
D  errCode                    1024    OPTIONS(*VARSIZE)        
D  callStkEntLen                10I 0 CONST OPTIONS(*NOPASS)   
D  callStkEntQual...                                           
D                               20    CONST OPTIONS(*NOPASS)   
D  dspPgmMsgTime                10I 0 CONST OPTIONS(*NOPASS)   
D proc1           PR             5I 0                          
D   parm1                       10    CONST OPTIONS(*NOPASS)   
D proc2           PR             5I 0                          
D   parm1                       10    CONST OPTIONS(*NOPASS)   
D proc3           PR             5I 0                          
D   parm1                       10    CONST OPTIONS(*NOPASS)   
                                                               
D rc              S              5I 0                               
D                SDS                                                
D PSDS_Pgm          *PROC                                           
                                                                    
D $MH_RPG_IV_ENTRY...                                               
D                 C                    CONST('_QRNP_PEP_')          
                                                                    
C                   EVAL      rc = proc1                            
                                                     
             
C                   SETON                                        LR 
C                   RETURN                                          
                                                                    
C     *PSSR         BEGSR                                           
C     'In PSSR'     DSPLY                                           
C                   SETON                                        LR 
C                   RETURN                                          
C                   ENDSR                                           
                                                                    
P proc1           B                   EXPORT                        
D proc1           PI             5I 0                               
D   parm1                       10    CONST OPTIONS(*NOPASS)        
C                   RETURN    proc2                                 
P proc1           E                                                 
P proc2           B                   EXPORT                             
D proc2           PI             5I 0                                    
D   parm1                       10    CONST OPTIONS(*NOPASS)             
C                   RETURN    proc3                                      
P proc2           E                                                      
                                                                         
P proc3           B                   EXPORT                             
D proc3           PI             5I 0                                    
D   parm1                       10    CONST OPTIONS(*NOPASS)             
D msgKey          S              4                                       
D errCode         S              8    INZ(X'0000000000000000')           
C                   CALLP     QmhSndPgmMsg('CPF9898' :                   
C                                          'QCPFMSG   *LIBL     ' :      
C                                          'Oops, it broke' :            
C                                          14 :                          
C                                          '*ESCAPE' :                   
C                                          $MH_RPG_IV_ENTRY + PSDS_Pgm : 
C                                          0 :                           
C                                          msgKey :                      
C                                          errCode :                     
C                                          20 :                          
C                                          '*NONE     *NONE' :           
C                                          0 )                           
C                   RETURN    3                                          

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.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
+---
| 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.