|
Thanks Simon, I understand the basic principles now.. Geir -----Original Message----- From: cobol400-l-bounces+geir.kildal=nordeafinans.no@xxxxxxxxxxxx [mailto:cobol400-l-bounces+geir.kildal=nordeafinans.no@xxxxxxxxxxxx]On Behalf Of Simon Coulter Sent: Wednesday, October 04, 2006 2:24 PM To: COBOL Programming on the iSeries/AS400 Subject: Re: [COBOL400-L] Calling COBOL from RPG/RPGLE? On 04/10/2006, at 9:52 PM, <Geir.Kildal@xxxxxxxxxxxxxxx> wrote:
My environment is COBOL, but I do have a couple of RPGLE-pgms, from where I need to call a COBOL pgm passing parameters to an from. Can anyone describe the CALL-statement in RPGLE for me please? And the definition of the parameters. Thanks.
Refer to RPGLE Reference manual for details. Old fashioned but simplest method: CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq. ... C CALL 'COBOLPGM' C PARM p1 100 C PARM p2 15 5 Slightly better but still old fashioned method: CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq. ... C COBOLPARMS PLIST C PARM p1 100 C PARM p2 15 5 C CALL 'COBOLPGM' COBOLPARMS Modern method (fixed form): DName+++++++++++ETDsFrom+++To/ L+++IDc.Keywords+++++++++++++++++++++++++++++ D cobolPgm PR EXTPGM('COBOLPGM') D p1 100 D p2 15 5 D parm1 S 100 D parm2 S 15 5 CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq. ... C CALLP cobolPgm( parm1 : parm2 ) Modern method (free form): DName+++++++++++ETDsFrom+++To/ L+++IDc.Keywords+++++++++++++++++++++++++++++ D cobolPgm PR EXTPGM('COBOLPGM') D p1 100 D p2 15 5 D parm1 S 100 D parm2 S 15 5 /FREE cobolPgm( parm1 : parm2 ); /END-FREE Obviously there will be other code involved to set the parameter values and the parameter definitions will be different (i.e., data types and number of parameters) but you should get the gist of it and the COBOL LINKAGE must have matching parameter definitions. Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
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.