× 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: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Thu, 23 Dec 1999 10:38:58 -0500

David, try:
C                   callp(e)  QCMDEXC(CMD:128)
C                   if        %error          
C                   dump                      
C                   endif                     

This works on V4R2.

Buck Calabro
Aptis; Albany, NY

> -----Original Message-----
> From: David Gibbs 
> Sent: Thursday, December 23, 1999 10:03 AM
> To:   'RPG400 Mailing List'
> 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
> 
+---
| 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.