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



Paul,

This is a "feature". Because CL differs from RPG in the way it passes
parameters, you must take explicit action to prevent problems passing
1-byte parameters between CL and RPG when using CallPrc.

You can either code parameters as 2-byte and then strip off what you
need or if you're at V5R1 you can use keywords on your prototype to
permit 1-byte (in your case indicator) parameters twixt CL and RPG.
Following is an example service program and program that calls its
procedure via CallPrc.

H NoMain

D MyProc          Pr              N   ExtProc( *CL: 'MYPROC' )
D  ParameterIn                   1

P MyProc          B                   Export

D MyProc          PI              N
D  InputFld                      1

 /Free

       If InputFld = *Blank ;
         Return *Off ;
       Else ;
         Return *On ;
       EndIf ;

 /End-Free

P MyProc          E



Pgm

  Dcl    &MyFld  *Char ( 1 )
  Dcl         &MyRtn  *Lgl

  ChgVar     &MyFld      ( 'A' )
  CallPrc    Prc( MyProc ) Parm( &MyFld ) RtnVal( &MyRtn
)
  ChgVar     &MyFld      ( ' ' )
  CallPrc    Prc( MyProc ) Parm( &MyFld ) RtnVal( &MyRtn )

EndPgm



Paul Jackson wrote:
>
> I have an ILE RPG procedure that does a return of an
> indicator type (N) indicating a true/false condition.
>
> When I try to call the procedure from CL using CALLPRC
> and define a *LGL variable to receive the result I am
> always getting X'01' in the cl variable regardless of
> the value of the indicator field in the RPG procedure.
>
> Couldn't find anything obvious in the on-line manuals.
>
> Any ideas?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.