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



rob@xxxxxxxxx wrote:
> Overlaying an array.
>
>      D FLWORKREC       DS                  likerec(flworkr)
>      D pDuh            s               *   inz(%addr(flworkrec))
>      D duh             ds                  based(pDuh)
>      D  col                          15p 4 overlay(duh:39) dim(389)
>
> Rob Berendt

<snip> One problem is that any workaround (easy or not) is fraught with
certain dangers.  For example, if the field layout happens to change, the
overlay may become invalid.
<snip>

could pDuh be defined as inz(%addr(arrayfld))
if so, it would not matter if the layout changes, only if the arrayfld size
changes.


Joe Giusto II
Programmer/Analyst
Ritz Camera
Beltsville, MD
301-419-3209 x347
410-813-2812 x347

 -----Original Message-----
From:   rpg400-l-bounces+jgiusto=ritzcamera.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+jgiusto=ritzcamera.com@xxxxxxxxxxxx]  On Behalf Of
Hans Boldt
Sent:   Tuesday, April 29, 2003 1:09 PM
To:     rpg400-l@xxxxxxxxxxxx
Subject:        Re: Adding another subfield to an externally defined data 
structu
re.

rob@xxxxxxxxx wrote:
> Overlaying an array.
>
>      D FLWORKREC       DS                  likerec(flworkr)
>      D pDuh            s               *   inz(%addr(flworkrec))
>      D duh             ds                  based(pDuh)
>      D  col                          15p 4 overlay(duh:39) dim(389)
>
> Rob Berendt

Rob: Maybe I'm a little thick today, but doesn't that code fragment
accomplish what you want?

I guess this all goes back to the decision in DDS not to support
arrays in records. The argument goes that arrays should be
implemented in tables, not within individual rows, in a relational
database (ignoring the fact that some RDBMS's do allow arrays within
rows).

So the question becomes, should a programming language make it easy
to get around a design limitation in the database? One problem is
that any workaround (easy or not) is fraught with certain dangers.
For example, if the field layout happens to change, the overlay may
become invalid.

The bottom line is that if EXTNAME suits your purposes better than
LIKEREC, then continue to use it.

Cheers! Hans


_______________________________________________
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.cgi/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.