× 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'm trying to call an RPGIV sub-procedure from a CLLE program and return a
value.  When I step through the program in Debug, the passed parameter is
full of garbage in the sub-procedure...

Here is the CLLE code...

             PGM

             DCL        VAR(&AUDITVALUE) TYPE(*CHAR) LEN(10)
             DCL        VAR(&TYPE) TYPE(*CHAR) LEN(10) VALUE('AUDIT')

             CALLPRC    PRC(#GETSYS) PARM(&TYPE) RTNVAL(&AUDITVALUE)

             SNDPGMMSG  MSG(&AUDITVALUE)

             ENDPGM


Here is the #getSys routine...

h nomain
 /copy camratst/qrpglesrc,cp_hspecs

fcafpsys   if   e           k disk    usropn

 *--------------------------------------------------------------------
 *Prototypes
 /copy servicelib/qrpglesrc,pr_allserv
 /copy camratst/qrpglesrc,pr_allcam

p #getSys         b                   export

d #getSys         pi            10
d  type                         10    value

 *--------------------------------------------------------------------
 * Stand Alone Fields
d value           s                   like( SYSVALUE )


c                   open      cafpsys
c                   eval      type = #allCaps( type )

c     type          chain     cafpsys
c                   if        %found( cafpsys )
c                   eval      value = %trim( SYSVALUE )
c                   endif

c                   close     cafpsys
c                   return    value

c                   eval      *inlr = *on

 *--------------------------------------------------------------------
p #getSys         e


'TYPE' is the incoming parm: here is what it receives in Debug...

TYPE = 'Ø*******KH'



BTW, this works fine when called from another RPGIV procedure...

TIA,

Joel R. Cochran
Director of Internet Services
VamaNet.com
(800)480-8810
mailto:webmaster@vamanet.com



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.