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



Well I totally misread your intent -- it's AFTER work here ;)

Usually for this kind of thing I will declare several "templates" (one that
describes each data "format"), then declare a structure of each type and
base those all on the same address -- the address of wherever the data
really exists (parameter, file field, user space, wherever). Do you have
like a big buffer you pass around and depending on byte 1 the interpretation
of that buffer changes (or some such)? Based structures are perfect for
that I think. Saves storage and moving around of data.

Stu


On Tue, Mar 23, 2010 at 15:33, Stuart Rowe <rowestu@xxxxxxxxx> wrote:


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" in
regard
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 thread ...

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.