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



Gary

I think you got confused by Rob's use of the word subprocedure and the command CALLSUBR.

In a single CL program there are NO subprocedures that are callable from within the same CLLE program.

There are subroutines since around V5R4 that you can use within CL - I think they are very nice for compartmentalizing code and cleaning up the main section, something we've not been able to do in CL before that.

See some of the other posts in this thread for more about this - including thoughts similar to yours - but any other CL "procedures" need to be in completely separate objects - I can envision a service program built from multiple CL *modules, somewhat following what you suggested here.

But those will not be called with CALLSUBR.

Cheers
Vern

On 10/31/2014 7:35 AM, Gary Thompson wrote:
Rob,
I don't have an example to answer your question, but I guess the
prototype would be like one for an RPGLE subprocedure ?

I have only one current CLLE showing what I think you already know:
FSP975DNC *MODULE CLLE CLLE *Module to Test stored proc FSP957DN

The source:

PGM
DCL &OutLoc TYPE(*CHAR) LEN(04)
DCL &CtoNum TYPE(*DEC) LEN(13 0)
DCL &BatDat TYPE(*DEC) LEN(7 0)
DCL &DocNum TYPE(*CHAR) LEN(11)
CHGVAR VAR(&OutLoc) VALUE('82 ')
CHGVAR VAR(&CtoNum) VALUE(8268773)
CHGVAR VAR(&BatDat) VALUE(1140627)
CHGVAR VAR(&DocNum) VALUE(' ')
CALLPRC PRC('SWIRETEST/FSP975DN') +
PARM((&OUTLOC) (&CTONUM) (&BATDAT)) +
RTNVAL(&DOCNUM)
End_Lbl:
ENDPGM

I've been thinking I will eventually us a CLLE *MODULE to return
a value(s) to an RPGLE *MODULE because I have a lot of code calling
QCMDEXC that's limited to a simple If %Error "interface".

My current project uses legacy parm passing between RPGLE - CLLE,
so if I can make the switch today I'll be glad to share that.



-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Friday, October 31, 2014 5:12 AM
To: Midrange Systems Technical Discussion
Subject: RE: Coding procedures in CL

How do you specify the return variable on a CL subprocedure (not
subroutine) then Gary?


Rob Berendt


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.