×
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.
----- Original Message -----
From: "Peter Dow (ML)" <maillist@xxxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Sunday, March 02, 2008 12:17 AM
Subject: Re: Use SQL to load an Array
"The values of the ALIGN and ALTSEQ keywords are inherited by the new
data structure. The values of the OCCURS, DIM, NOOPT, and INZ keywords
are not inherited. To initialize the subfields in the same way as the
parent data structure, specify INZ(*LIKEDS)."
Thanks - I see that now. I think what threw me off more than anything is
the inconsistency of LikeDS and the DIM statement. I use DIM on subfields
all the time, and LikeDS does copy those DIMs to the new structure. I
assumed (and yes, I do know what that makes me) it would behave the same at
the DS level.
I can definitely see the value of being able to override the DIM on the
duplicate structure, but I think it would have made a lot more sense to have
it default to matching the original structure's declaration. That way you
could override if needed to return much more or much less data than
originally anticipated, otherwise just go about your business.
Inz(*LikeDS) does not copy the DIM specs over either. The only two ways I
see to make sure the new DS has the same DIM are:
1 - Hardcode the DIM(50) on both DS specifications
2 - Use a hardcoded constant in the DIM for both like DIM(partRecs), where
partRecs is a constant with a value of 50.
A compromise would be if the DIM() statement could use %elems(). Then you
could code the DIM(%elems(origArr)) - but alas that does not work.
Thanks again for your thoughts,
JD
As an Amazon Associate we earn from qualifying purchases.