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



 >> Is it possible to declare a multi occurrence data structure as the
return value from a procedure in a RPG/COBOL program.

Sort of - but you may not want to.  Also I'm not sure what you mean about
COBOL since there is no such thing in the language.

Three points:

1) You will (I'm fairly certain but don't have time to check) only be
returning one occurrence.  If you want to return multiples you should use a
DS array rather than a MODS.  They are much more useful anyway.

2) It is generally a bad idea to return anything as large as such a DS would
usually be.  All return values are just that - they are returned by _value_
i.e. copied.  OK for a 200 byte record - really bad idea for a honking great
DS.

3) If you must use a MODS then I would suggest you return a count of the
number of entries returned and pass the actual MODS itself as a parm.  If
you do this with a MODS you must ensure that the occurrence is set to 1
before you make the procedure call.

Jon Paris
Partner400

www.Partner400.com
www.RPGWorld.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.