Dave, would the (E) and %ERROR be useful?  

Here's the Help from Code/400:


+--------------------------------------------------------------------+
|Code         |Factor 1     |Extended Factor|         |    |    |    |
|             |             |2              |         |    |    |    |
|-------------+-------------+---------------+---------+----+----+----|
|CALLP (E M/R)|             |NAME{ (Parm1   |         |    |    |    |
|             |             |{:Parm2...}) } |         |    |    |    |
+--------------------------------------------------------------------+

The CALLP operation is used to call prototyped procedures or programs.

Note that if CALLP is used to call a procedure which returns a value, that value will not be available to the caller. If the
value is required, call the prototyped procedure from within an expression.
...
To handle CALLP exceptions (program status codes 202, 211, or 231), the operation code extender 'E' can be
specified. For more information on error handling, see Program Exception/Errors.

Note:    The E extender is only active during the final call for CALLP. If an error occurs on a call that is done as part
         of the parameter processing, control will not pass to the  next operation. For example, if FileRecs is a
         procedure returning a numeric value, and an error occurs when FileRecs is called in the following
         statement, the E extender would have no effect.

         CALLP (E) PROGNAME(FileRecs(Fld) + 1)
         
_______________________
Booth Martin
boothm@earth.goddard.edu
http://www.spy.net/~booth
_______________________



David Gibbs <dgibbs@mks.com>
Sent by: owner-rpg400-l@midrange.com

12/23/1999 10:02 AM
Please respond to RPG400-L

       
        To:        "'RPG400 Mailing List'" <rpg400-l@midrange.com>
        cc:        
        Subject:        Trapping errors with CALLP?


Folks:
 
I've run into a problem using CALLP ... I can't trap errors.
 
When using a normal call I can put a conditioning indicator on the call so that, if the called program fails, it simply returns to the caller and turns on an indicator.
 
I can't find a way to do that will CALLP.
 
For instance ... the following code will work fine ... it just returns to the command line after a call with a message in the joblog ...
 
D LEN             S             15P 5                                  
C                   eval      CMD = 'ADDLIBLE ASDF'                    
C                   call      'QCMDEXC'                            99  
C                   parm                    CMD             128        
C                   parm      128           LEN                        
C                   eval      *inlr = *on                              
C                   return                                            

 
However, this code throws a fit ...
 
DQCMDEXC          PR                  EXTPGM('QCMDEXC')        
D prCmdStr                    4096A   CONST                    
D prCmdLen                      15P 5 CONST                    

D LEN             S             15P 5                        
D CMD             S            128A                          
C                   eval      CMD = 'ADDLIBLE ASDF'          
C                   callp     QCMDEXC(CMD:128)                
C                   eval      *inlr = *on                    
C                   return                                    

 
 
Any suggestions?
 
 
Thanks and have a happy & safe holiday!
 
david

--

David Gibbs
Sr. Software Engineer
Mortice Kern Systems US, Inc.
2500 S. Highland Ave., Suite 200
Lombard, IL  60148

phone: (630) 495-2108 x5004
http://www.mks.com
mailto:dgibbs@mks.com

Opinions expressed are strictly my own and do
not necessarily reflect those of my employer.

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.