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




Hi,

I don't know if it's "official" (whatever that means) but i would say that MODS should be considered depricated and the use of it is bad practice, for several reasons.

1) Arrays provide the same functionality but with a more consistent and "industry standard" syntax (most languages have some form of arrays). Why introduce some completely new syntax for something that seems to be just an array, as we already have arrays in RPG. Thus it seems much more straightforward to alow the DIM keyword on datastructures. I never understood why this was not done like this when MODS where introduced. Arrays are also more versatile and straight-forward, e.g. when defining nested array structures. Of course, "straight forward" is subjective. If you are used to using MODS then using arrays for the same purpose seems less "straght forward", at first. But MODS are quite specific to RPG (dont know about them in other languages) and do not have a extra value. To me MODS seems to be a bad implementation, or rather language design, of a datastructure array.

2) Everywhere you use MODS you can use datastructure arrays, but not the other way around. E.g. you can't explicitly define nested MODS in RPG, as you can with datastructure arrays. So instead of using two syntaxes / concepts for the same thing one could better "standardize" on just one, being datastructure arrays.

3) A big problem with MODS is that it makes it easy to create bugs (it sure doesn't help against it). This is because with arrays, the index of element you are refering is explicit, while with MODS it's implicit. With MODS, you "set" the index with some built-in function or opcode somewhere in your code and somewhere else in the code you refer to the "current" element. The relation to the exact element in this last piece of code is not explicit because there is only some concept of a "current" element, which is like having an datastructure array with exactly one built-in index. Besides making it difficult to track down problems (like refering to the wrong element in which you need to track down the code which inadvertely sets the "current" element), it's also more complicated if youo need more than one index. For example you want to delete one element and move the rest of the elements you normally use two indexes, e.g. I and J, namely the current "free" element and the current element. Each time you refer to an element in the MODS you have to set the "current" element to I or J. This not only takes those extra statements to set the "current" element, but it's also more prone to error like described before (like forgetting to set the current element).

Jacobus

From: tuohyp@xxxxxxxxxxxxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Multi- Occurrence Data Structure
Date: Wed, 12 Dec 2007 00:27:56 +0000

Not true Jeff - I am on V5R3 and using DS Arrays for multi row fetch in SQL.

Regards

Paul Tuohy
ComCon
www.comconadvisor.com
www.systemideveloper.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Jeff Young
Sent: 11 December 2007 21:51
To: RPG programming on the AS400 / iSeries
Subject: Re: Multi- Occurrence Data Structure

As of V5R3, you could not use DS Arrays for multi row fetch in SQL.
It had to be a MODS only.

Thanks,


Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions
V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions
Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions
Implementer V5R3









----- Original Message ----
From: Kurt Anderson <kjanderson@xxxxxxxxxxxxx>
To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, December 11, 2007 3:33:28 PM
Subject: RE: Multi- Occurrence Data Structure

We use MODS to store result sets from a SQL Fetch. Can data structure
arrays be used as well?


Kurt Anderson
Application Developer
Highsmith Inc

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Glenn Gundermann
Sent: Tuesday, December 11, 2007 1:21 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Multi- Occurrence Data Structure

They aren't used anymore.
Data Structure Arrays are used in its place.

Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295

Hi Group,

Can any explain me how to use Multi-Occurrence Data structure..
in which sitiuation it is used.


Thanks in advance

Regards,
Srinivas

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


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



____________________________________________________________________________
________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
--
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.

















































































































































































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


_________________________________________________________________
De mooiste afbeeldingen van Angelina Jolie vind je met Live Search
http://search.live.com/images/results.aspx?q=angelina%20jolie&FORM=MIINTM

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.