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



Mike -

For a cleaner approach (rather than monitoring for a message) you can call
CEETSTA within a CLLE to check to see if a particular parameter was passed
or not.

See code snippet below.

- sjl


PGM PARM(&P1 &P2 &P3)

<Snip>

DCL &Parm1 *CHAR 25
DCL &Parm2 *CHAR 25
DCL &Parm3 *CHAR 25
DCL &B1 *CHAR 4
DCL &B2 *CHAR 4
DCL &B3 *CHAR 4
DCL &PARMNO *CHAR 4

CHGVAR VAR(%BIN(&PARMNO)) VALUE(1)
CALLPRC PRC(CEETSTA) PARM(&B1 &PARMNO *OMIT)

CHGVAR VAR(%BIN(&PARMNO)) VALUE(2)
CALLPRC PRC(CEETSTA) PARM(&B2 &PARMNO *OMIT)

CHGVAR VAR(%BIN(&PARMNO)) VALUE(3)
CALLPRC PRC(CEETSTA) PARM(&B3 &PARMNO *OMIT)


IF COND(%BIN(&B3) *EQ 1) THEN(Do)
CALL PGM(Program3) Parm(&Parm3)
Enddo
.
.
.

</Snip>


Mike wrote:
Is there any way to keep a CL program from failing if too few parameters are
passed like you can in RPG by detecting the number of parameters with
%parms() and then not referencing the missing parameter(s) if they were not
passed? I have a CL program that is called from about 50 other applications
and I need to add a new parameter for just one new function to be used
currently in one application.



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.