|
David,
> david@midrange.com on 12/23/99 10:34:35 AM wrote:
>
>> CALLP(E) and check %error
>>
>> I've run into a problem using CALLP ... I can't trap errors.
>
>I forgot to mention ... I'm compiling to V3R2 :(
>
>david
You are stuck. Your only choices are to target a more recent release, not
use CALLP or call a procedure that cannot fail. For this particular
problem, I'd build a cheap CL program to do the CALL to QCMDEXC, MONMSG it
and pass back a "failed" return code:
DQCMDEXC PR EXTPGM('CMDCLPGM')
D prCmdStr 4096A CONST
D prCmdLen 15P 5 CONST
D prCmdErr 1A
C callp QCMDEXC(CMD:128:ReturnCode)
PGM (&CmdInp &CmdLen &ReturnCode)
DCL &CmdInp *CHAR 4096
DCL &CmdLen *DEC (15 5)
DCL &ReturnCode *CHAR 1
ChgVar &ReturnCode ' ' /* OK by default */
CALL QCMDEXC (&CmdInp &CmdLen)
MONMSG CPF0000 Exec(Do)
ChgVar &ReturnCode 'F' /* Failed! */
EndDo
ENDPGM
Buck
+---
| 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 mailing list archive is Copyright 1997-2025 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.