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



Simple answer - No because COBOL has no notion of prototyping.

More complicated answer. The example you gave includes a varchar which COBOL does not natively support.

This is a quick and dirty translate.

Please contact me off line - I have other stuff that can help you but can't offer it publicly.


Process Options NOMONOPRC NOSTDTRUNC
Identification Division.
Program-Id. PLAY.
Data Division.
Working-Storage Section.

01 CallData.
05 Parm1 pic 9(9) Binary.
05 Parm2.
10 Parm2Len pic 9(4) Binary.
10 Parm2Data pic X(21). .
05 Parm3 pic x.
05 Parm4 pic x(256).

05 ReturnValue pic 9(9) Binary.

Procedure Division.
Main.

move "Whatever" to Parm2Data.

move function Length ( function trimr (Parm2Data) )
to Parm2Len.

* Using all 4 parms

Call linkage procedure "function_call"
Using Parm1, Parm2, Parm3, Parm4
Returning ReturnValue.

* Using 3 parms
Call linkage procedure "function_call"
Using Parm1, Parm2, Parm3
Returning ReturnValue.

Stop Run.



Jon Paris

On Aug 11, 2020, at 9:36 AM, Brad Stone <bvstone@xxxxxxxxx> wrote:

Ok, I think I'm taking another path. What I'd like to do is call ILE
subprocedures written in RPG from COBOL. The COBOL system is V7R1 (not my
choice.. it's a client).

So I guess now I need to know if it's possible to convert prototype
definitions from RPG to COBOL. As an example:

dcl-pr function_call int(10);
parm1 int(10);
parm2 varchar(65535);
parm3 char(1);
parm4 char(256) Options(*NOPASS);
end-pr;


Then of course I need to find some COBOL source to check out.. .like a
shell program that defines a few variables and calls a function.


Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #15 <https://www.bvstools.com/mailtool.html>: The ability
to add a Footer to each email sent using an IFS stream file.

On Mon, Aug 10, 2020 at 12:22 PM Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2020-08-09 2:05 p.m., Brad Stone wrote:
This may seem like an odd question, but are there any materials that show
how you can convert a data structure and field definitions from RPG to
COBOL for the IBM i?
...

The ILE COBOL Programmer's Guide has some mappings betweem COBOL and
fixed-form RPG definitions.

https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzase/cblcalrpgtyp.htm

--
Barbara

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.