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



You are being a little thick today.  :-)
You're right.  The code fragment works.  However, if it supported overlays 
then I wouldn't have to declare the second data structure, nor the 
pointer.

What's DDS?  SQL - SQL - SQL (ducking and running)

You're right about the possible layout change causing problems.  How could 
I have gotten around that?  Granted instead of declaring the field 15P 4 I 
could have used LIKE.  But overlay doesn't support overlaying a smaller 
field with a bigger field - which would be idea!  Then the smaller field 
would simply be the starting position in the data structure.  Hey - 
there's another change!  Any chance it would work like I want it to if I 
dropped the severity level on that message?

And I would be happy as a clam to continue using EXTNAME versus LIKEREC if 
only you allowed me to use that on a chain into a data structure.

If you would have asked me a few months ago if there was any use for 
chaining into a data structure I would have thought you nuts.  However, 
for ensuring that the fields use contiguous memory, and for overlaying, it 
has proven quite useful.

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




Hans Boldt <boldt@xxxxxxxxxx>
Sent by: rpg400-l-bounces+rob=dekko.com@xxxxxxxxxxxx
04/29/2003 12:08 PM
Please respond to RPG programming on the AS400 / iSeries
 
        To:     rpg400-l@xxxxxxxxxxxx
        cc: 
        Fax to: 
        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.