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



I've had pretty good luck passing a pointer to the MODS, and returning that
along with the record count.

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com


                                                                           
             "Jon Paris"                                                   
             <Jon.Paris@Partne                                             
             r400.com>                                                  To 
             Sent by:                  <rpg400-l@xxxxxxxxxxxx>             
             rpg400-l-bounces@                                          cc 
             midrange.com                                                  
                                                                   Subject 
                                       RE: Multi Occurrence Data Structure 
             07/04/2005 02:00          returned from a procedure           
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
              RPG programming                                              
              on the AS400 /                                               
                  iSeries                                                  
             <rpg400-l@midrang                                             
                  e.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


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.