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




On 01/10/2009, at 12:08 PM, MichaelQuigley@xxxxxxxxxx wrote:

What's so different about the ILE architecture of COBOL vs RPG? RPG does
allow you to code subprocedures like function which is very cool. However,
you can still perform the same function by using 'CALL PROCEDURE'. My
recollection is that the structure of the program objects is the same.
I've written several programs to take advantage of this when I want to
hide internal procedures within a service program.

What you describe is syntactic sugar. Although I prefer RPG support for function calls that's not my complaint.

Try to create a collection of related functions in a single COBOL source member. For example, a set of string handling functions. In RPG or C that's easy: one source member containing a bunch of procedures (centre, leftAlign, rightAlign, to Upper, toLower, etc,). For RPG specify EXPORT on the procedure definition. In COBOL you need to create each procedure in a separate source member--like ILE RPG in its first incarnation. Although you can have nested programs (invoked via call procedure) you can't make them visible outside the containing module. You can't even call them from another module in the same *PGM or *SRVPGM.

Nested programs are effectively nothing more than a fancy sub-routine: parameters and locally scoped variables (which are good things) but that's it. Not a patch on the support offered by RPG and C.

ILE COBOL can call a "proper" procedure but it can't create them. Although you can achieve the same effect with COBOL it's much less work in other languages and seems a lot cleaner.

There are a bunch of other "peculiarities" with COBOL procedure support. For example, if you call a given procedure from more than one place in your code and you specify RETURNING on one call you must specify RETURNING on all calls to that procedure even if you don't care about the return value. I guess this is a "poor man's" prototyping attempt.


Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
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.