× 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.



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.

This thread ...

Follow-Ups:
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.