× 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: Gary Guthrie <GaryGuthrie@xxxxxxxx>
  • Date: Thu, 23 Dec 1999 11:48:06 -0600



Alan Campin wrote:
A few comments/questions...

Question 1: Where is this well-documented fact documented?

Question 2: Where do we find IBM's recommendation against prototyping
program calls?

Question 3: Who, within IBM, makes this recommendation?

Now for the comments...

There is no execution difference between a CALL PGM and a prototyped
CALLP PGM. The manner in which you monitor for errors differs, but you
give up no ability to do so with a prototyped call. With the CALL
opcode, you check for an error using a resulting indicator. With the
CALLP opcode, you check for an error using the operation extender as
CALLP(E). You then check the %ERROR BIF instead of an indicator to
determine if an error occurred. And, with CALL or CALLP you can
interrogate the program status data structure for further information
(though it's not a lot of info!).

Gary Guthrie
Technical Editor, NEWS/400 magazine at http://www.news400.com


 
> This is a well documented fact when prototyping calls to programs. That is
> why IBM recommends that we do not prototype program calls. What I would
> recommend instead is to wrap the call in a function, preferably in a service
> program, or copy block  and then you can just call it with a
> ExecCmd(String). I never call a QCMDEXC directly although I have a
> programmer who insists on putting QCMDEXEC logic in every single program he
> writes. Drives me crazy.
> 
> -----Original Message-----
> From: Rob Berendt [mailto:rob@dekko.com]
> Sent: Thursday, December 23, 1999 8:20 AM
> To: RPG400-L@midrange.com
> Subject: Re: Trapping errors with CALLP?
> 
> 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.
> 
> 
> 
> +---
> | 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
> +---
+---
| 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 ...

Replies:

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.