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



S
Hello Geir,

You wrote:
>In an old RPGpgm, RPG1, I called a COBOLpgm, CBL1 with a PLIST  PLIS1
>containing PARAM1, PARAM2 and PARAM3.  The Call was like this:
>CALL 'CBL1' PLIS1(Standard OPM RPG, the parameters are bringing data into
>CBL1 and are receiving data from CBL1)

>RPG1 is converted into RPGLE1, and CBL1 is converted into CBLLE1, and
>bound together into one ILEpgm, RPGLE1.  I now need a CALLP(static call)
>instead of the old dynamic CALL, I have figured that out, but how do I
>prepare my parameterdefinitions to this inside RPGLE1??  Does anyone have
>a small example?

The simplest approach is to replace the CALL with CALLB, compile and bind.

However, using CALLP is better because it forces you to prototype the call
thus allowing the compiler to:
        a/ Verify that the parameters you pass match the parameters expected
by the called program
        b/ perform data conversions as required to coerce (or cast) the data
type you provide into the one preferred by the prototype.

Here is a quick example (you'll have to correct the column positions).

The prototype goes in a copy member (e.g., protos):

D doCobolStuff  PR                              EXTPROC('COBOLPGM')
D   param1                                10    CONST
D   param2                                 7  2 CONST
D   param3                                 5S 0 CONST

The RPG IV code looks like:

 /copy protos

D first         S               10
D second        S                7  2
D third         S                5S 0

C               CALLP       doCobolStuff( first : second : third )

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   «»
«» Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /   «»
«»                                                           X    «»
«»               ASCII Ribbon campaign against HTML E-Mail  / \   «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.