× 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: Rob Berendt <rob@xxxxxxxxx>
  • Date: Thu, 23 Dec 1999 10:20:08 -0500

CALLP(E)  and check %error




dgibbs@mks.com on 12/23/99 10:11:14 AM
Please respond to RPG400-L@midrange.com@Internet
To:     rpg400-l@midrange.com@Internet
cc:      
Fax to: 
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 <http://www.mks.com/> 
mailto:dgibbs@mks.com <mailto:dgibbs@mks.com> 


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

 


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT size=2><SPAN class=945195914-23121999>Folks:</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>I've run into a problem using 
CALLP ... I can't trap errors.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>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.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>I can't find a way to do that 
will CALLP.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>For instance ... the following 
code will work fine ... it just returns to the command line after a call with a 
message in the joblog ...</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>D 
LEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 15P 
5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
<BR>C&nbsp;&nbsp;&nbsp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FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>However, this code throws a 
fit 
...</SPAN></FONT></DIV>>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN 
class=945195914-23121999>DQCMDEXC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
PR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
EXTPGM('QCMDEXC')&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>D 
prCmdStr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
4096A&nbsp;&nbsp; 
CONST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
<BR>D 
prCmdLen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
15P 5 
CONST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>D 
LEN&nbsp;&nbsp;&nbsp;&nbs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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
<BR>C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
eval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *inlr = 
*on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
<BR>C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>Any 
suggestions?</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>Thanks and have a happy &amp; 
safe holiday!</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=945195914-23121999>david</SPAN></FONT></DIV>
<P><FONT size=2>--</FONT></P>
<P><FONT size=2>David Gibbs<BR>Sr. Software Engineer<BR>Mortice Kern Systems 
US, 
Inc.<BR>2500 S. Highland Ave., Suite 200<BR>Lombard, IL&nbsp; 60148</FONT></P>
<P><FONT size=2>phone: (<FONT size=2>630) 495-2108 </FONT>x5004<BR></FONT><FONT 
color=#000000 size=2><A href="http://www.mks.com/">http://www.mks.com</A><BR><A 
href="mailto:dgibbs@mks.com">mailto:dgibbs@mks.com</A><BR></FONT></P>
<P><FONT color=#000000 size=2>Opinions expressed are strictly my own and do 
<BR>not necessarily reflect those of my employer.</FONT></P>
<DIV>&nbsp;</DIV></BODY></HTML>

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.