|
Can't augment a pre-defined structure (template). You're going to have to
declare 2 structures: one using likeds, and one not (this will contain the
file field names in the right places). Base the file-field structure on the
likeds structure and they'll be equivalent. Use either one.
D fileFields@ S * inz( %addr( fileFields ) )
D fileFields DS <=== DO NOT
QUALIFY THIS
D Test 1p 0
D anotherField 10a overlay( fileFields: 42 )
D ds_CGR DS LikeDS( dsTmpl_CGR_01 )
D based( fileFields@ )
or something like that. Forgive my poor indenting. You can use "overlay(
fileFields: xxx )" if you only need a couple of fields out of the record and
they're not contiguous. The fileFields and fileFields@ must be global
variables.
Stu
On Tue, Mar 23, 2010 at 12:01, Rory Hewitt <rory.hewitt@xxxxxxxxx> wrote:
Kurt,
I seem to remember that you're just not allowed to add fields to the end
of
a Likeds DS (unlike, say, an EXTNAME DS).
However, in either case, doing an overlay to a subfield in the 'liked' DS
(ds_Tmpl_CGR_01.Cat) would be wrong. If it is allowed, I would have
expected
Overlay( Cat: 2 ) to work - when doing an overlay, you simply specify the
subfield name (which obviously must exist in the same DS).
Rory
On Tue, Mar 23, 2010 at 9:34 AM, Kurt Anderson <
kurt.anderson@xxxxxxxxxxxxxx
wrote:
Just realized that my the code I gave was my "last ditch attempt" inregard
to the overlay.--
I had originally tried: Overlay( Cat: 2 )
and then: Overlay( ds_CGR.Cat: 2 )
This is the RPG programming on the IBM i / System i (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.
As an Amazon Associate we earn from qualifying purchases.
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.