Roman's example cited below works. (You can also handle what the specific
archived message was after by separating storage into the WORKING-STORAGE
AND LOCAL-STORAGE sections.) You also don't have to code a RETURNING
phrase on your calls--nothing wrong with doing it, but it isn't required.
You can just pass parameters like any other call. You can also specify
OMMITED for parameters you are not passing--although coding for omitted
parameters is a little cumbersome in a subprogram/subprocedure. It's been
a little while since I wrote one but if I recall correctly, data declared
in a main or outer procedure is available to the sub procedures without
specifying it in the USING phrase. You can find information on all of
this in the ILE COBOL Language Reference and the ILE COBOL Programmer's
Guide. These are available in WDSC/RDi or in the Information Center at: for V5R4 or for
V6R1. You may also find the ILE Concepts manual very helpful V5R4: or Version 6.1:

Michael Quigley

cobol400-l-bounces@xxxxxxxxxxxx wrote on 09/30/2009 01:00:12 PM:

----- Message from RMiklos@xxxxxx on Wed, 30 Sep 2009 09:12:18 +0200


COBOL Programming on the iSeries/AS400 <cobol400-l@xxxxxxxxxxxx>


Re: [COBOL400-L] Procedure equivalent in Cobol

In normal COBOL you have only sections and paragraphs.

But in ILE COBOL you can:

1. Create a module, where you define a procedure or function with

USING argument

2. Place your module with the procedure in a service program

3. call the procedure/function from an other module using
USING argument

Here is an example from the archive of this mailing list:

steelville <steelville@xxxxxxxxxxx>
COBOL Programming on the iSeries/AS400 <cobol400-l@xxxxxxxxxxxx>
30.09.2009 01:59
[COBOL400-L] Procedure equivalent in Cobol
Sent by:

I just joined a mixed-code shop, and there's plenty of RPG but most of
the code is Cobol. I know Cobol but I hate spelling it with all caps.

And I poked around in the manuals but can't get clear how ILE is
implemented in Cobol. Could I get direction on this. All I can find so
far is about either CRTBNDCBL and compiling one source member to one

I'd like to know if there's an equivalent to RPG's subprocedures and all



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-2022 by 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.