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



Alan Shore wrote:
Is it possible to call a subprocedure from a service program from within a
CL (or CLLE) program?

Yes.


I thought CALLPRC was the thing to use, but it definitely is not working.

It is. Can you be more specific about how it is not working? Is it failing at compile, bind, or run time?

Here is an example:

------- CL --------------

DCL &message *CHAR LEN(150)
DCL &messageLen *INT LEN(4)
DCL &messageV *CHAR LEN(1002)
...

CHGVAR var(&message) value('Message changed to +
protect the innocent')
CHGVAR var(&messageLen) value(150)
CALLPRC prc(UTRMSTRING_makeVarying) +
parm((&message) (&messageLen) (&messageV))
------- CL --------------

------- Procedure prototype --------------

D*--------------------------------------------------
D* Procedure name: UTRMSTRING_makeVarying
D* Purpose: Create a VARYING character variable to pass to RPG
D* Returns: Trimmed length of string, < 0 if error
D* Returns: Trimmed length of string, < 0 if error
D* Parameter: inputString => The string to convert to VARYING ...
D* character
D* Parameter: inputLength => Length of the input variable
D* Parameter: outputString => The string in VARYING character format ...
D* Unpredictable results will occur if the variable ...
D* you pass is shorter than inputLength + 2.
D*--------------------------------------------------
D UTRMSTRING_makeVarying...
D PR 10I 0
D inputString 65535A CONST
D OPTIONS(*VARSIZE)
D inputLength 10I 0 CONST
D outputString 65535A VARYING
D OPTIONS(*VARSIZE)
------- Procedure prototype --------------

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.