|
Hi Mike, > I'm not much of a C programmer so I didn't want to tackle that if there was > any other way. Not sure why you'd want to use C for this -- other than that it has the capability of checking the value of a pointer. But, so do many other languages. > So I'm just going to sandwich an RPGLE program between the Command and > the CL and have it check for Null Parms using the %Addr Function. That should work. (that's the same thing you would've done in C) Though, I wonder why you don't do the whole thing in RPG? why do you need CL? Or, alternately, you should be able to do the whole thing in ILE CL with the CEETSTA API. The jump from original CL to ILE CL isn't a big one -- the language syntax is identical, except that you now have the CALLPRC command, and you have to compile it with the CRTBNDCL command. The following program is a pure CL variant of the code that you posted using the CEETSTA API to see if the parms were passed: /* This should be source member type CLLE (not CLP!) */ /* compile with PDM opt 14 or CRTBNDCL */ PGM PARM(&P1 &P2 &P3) DCL &P1 *CHAR 25 DCL &P2 *CHAR 25 DCL &P3 *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) CHGVAR VAR(%BIN(&PARMNO)) VALUE(2) CALLPRC PRC(CEETSTA) PARM(&B2 &PARMNO) CHGVAR VAR(%BIN(&PARMNO)) VALUE(3) CALLPRC PRC(CEETSTA) PARM(&B3 &PARMNO) IF COND(%BIN(&B1) *EQ 1) THEN(CHGVAR VAR(&P1) + VALUE('PARM1')) IF COND(%BIN(&B2) *EQ 1) THEN(CHGVAR VAR(&P2) + VALUE('PARM2')) IF COND(%BIN(&B3) *EQ 1) THEN(CHGVAR VAR(&P3) + VALUE('PARM3')) RETURN ENDPGM
As an Amazon Associate we earn from qualifying purchases.
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.