I found this example of using CEETSTA.
Perhaps this approach can be used.
Michael
PGM PARM(&PARM1 &PARM2)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(3)
DCL VAR(&PARM2) TYPE(*CHAR) LEN(3)
DCL VAR(&PARMRESULT) TYPE(*INT) LEN(4)
DCL VAR(&PARMNUMBER) TYPE(*INT) LEN(4)
CHGVAR VAR(&PARMNUMBER) VALUE(1)
CALLPRC PRC(CEETSTA) PARM(&PARMRESULT &PARMNUMBER *OMIT)
IF COND(&PARMRESULT *EQ 1) THEN(DO)
CALL PGM(PROGRAM2) PARM(&PARM1 &PARM2)
ENDDO
ELSE CMD(DO)
CALL PGM(PROGRAM2) PARM(&PARM1)
ENDDO
ENDPGM
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, June 16, 2008 3:55 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: CL Optional Parameter Question
Hi Bruce,
Wouldn't you still get a "Parameters passed on CALL do not match those
required." error when you tried to call this? Unless you used ILE CL,
that is?
Bruce Vining wrote:
Sure. But it does need to be a *PGM.
PGM PARM(&PARM1)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(1)
DCL VAR(&TEST) TYPE(*CHAR) LEN(1)
CHGVAR VAR(&TEST) VALUE(&PARM1)
MONMSG MSGID(MCH3601) EXEC(DO)
RCVMSG MSGTYPE(*LAST)
SNDPGMMSG MSG('Not sent') TOPGMQ(*EXT)
RETURN
ENDDO
IF COND(&PARM1 = Y) +
THEN(SNDPGMMSG MSG('Sent') TOPGMQ(*EXT))
ELSE CMD(SNDPGMMSG MSG('Sent but no Y') +
TOPGMQ(*EXT))
ENDPGM
Bruce Vining
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
______________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
As an Amazon Associate we earn from qualifying purchases.