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



Thanks for the Responses.

I'm not much of a C programmer so I didn't want to tackle that if there was any other way. 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. Something like the code below:

Command with Return Values

            CMD        PROMPT('TEST NULL PARMS')
            PARM       KWD(PRM1) TYPE(*CHAR) LEN(25) RTNVAL(*YES) +
                         PROMPT('PARM 1')
            PARM       KWD(PRM2) TYPE(*CHAR) LEN(25) RTNVAL(*YES) +
                         PROMPT('PARM 2')
            PARM       KWD(PRM3) TYPE(*CHAR) LEN(25) RTNVAL(*YES) +
                         PROMPT('PARM 3')

CPP in RPGLE -- Figure out which Parms are Null

d p0Parm1         s             25
d p0Parm2         s             25
d p0Parm3         s             25
d v1Nul1          s                              Like(*In01)
d v1Nul2          s                              Like(*In01)
d v1Nul3          s                              Like(*In01)
c     *Entry        Plist
c                   Parm                    p0Parm1
c                   Parm                    p0Parm2
c                   Parm                    p0Parm3
c*
c                   Eval      v1Nul1 = *OFF
c                   Eval      v1Nul2 = *OFF
c                   Eval      v1Nul3 = *OFF
c*
c                   If        %Addr(p0Parm1) = *Null
c                   Eval      v1Nul1 = *On
c                   Endif
c*
c                   If        %Addr(p0Parm2) = *Null
c                   Eval      v1Nul2 = *On
c                   Endif
c*
c                   If        %Addr(p0Parm3) = *Null
c                   Eval      v1Nul3 = *On
c                   Endif
c*
c                   Call      'TSTPRM2'
c                   Parm                    p0Parm1
c                   Parm                    p0Parm2
c                   Parm                    p0Parm3
c                   Parm                    v1Nul1
c                   Parm                    v1Nul2
c                   Parm                    v1Nul3
c                   Return

CL Program TSTPRM2 -- Do assignments if Parm Not Null

PGM PARM(&P1 &P2 &P3 &B1 &B2 &B3)

DCL &P1 *CHAR 25
DCL &P2 *CHAR 25
DCL &P3 *CHAR 25
DCL &B1 *LGL
DCL &B2 *LGL
DCL &B3 *LGL

            IF         COND(*NOT &B1) THEN(CHGVAR VAR(&P1) +
                         VALUE('PARM1'))

            IF         COND(*NOT &B2) THEN(CHGVAR VAR(&P2) +
                         VALUE('PARM2'))

            IF         COND(*NOT &B3) THEN(CHGVAR VAR(&P3) +
                         VALUE('PARM3'))

RETURN

ENDPGM

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/



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.