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



On 6/19/2013 12:37 PM, Brian May wrote:
I don't think you are quite getting what *NEXT does.

In your example, I assume you are wanting the carr array to overlay c1 through c12. But that is not what you told it to do. You told it to overlay the data structure starting immediately after the last subfield defined for the structure you are overlaying. So it created the array after c12 since it is also a subfield of PF1_t. Others have already shown you the correct way to do this, which is to create a group field that the c1 - c12 fields will overlay using next. Then overlay the array over the same group field.

The point here is that *NEXT does not overlay starting after the previous overlay *NEXT. It starts after the previous subfield.


No, it starts at the next available position in the data structure.

D ds ds
D suba 1 5a
D subb 3a
D subc 2 3a
D subd 2a overlay(ds:*next)
/free
ds = '123456789';
subd = *all'd';
dsply ds;
return;

DSPLY 12345678dd

Subfield sub4 starts at position 9, after subb, not at position 4, after subc.

OVERLAY(dsname:*next) means "next available position in the data structure", which, as Jon has been saying, is the same as not specifying OVERLAY at all.

Arguably, *NEXT shouldn't even have been allowed for overlay on a data structure.


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.