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



Why use POS in this situation? You only -need- to use POS when you were OVERLAYING the data structure itself, not a subfield. Using POS in any other scenario is just like listing out the positions on a data structure, which in my eyes seems like an archaic coding method if OVERLAY was doable instead. What didn't work about Birgitta's freeform, other than the typo he had on SclLen? I'd even go a step further on your code and change the 2nd overlay to *Next. Why do that? Flexibility. If someday SclLen was changed to int(10) and DecPos & DecLen to int(5), then the programmer wouldn't need to change the Overlay.

With the DS Birgitta supplied, someone could add in a new subfield prior to SclLen without messing anything up. If you use the POS on DecPos and DecLen, then added a new subfield before SclLen, those subfields are suddenly going to be "overlaying" the wrong data.

The tweaked DS:
DCL-DS DPA_Template_T;
SclTyp Char(1);
SclLen Int(5);
DecPos Int(3) Overlay( SclLen: 1 );
DecLen Int(3) Overlay( SclLen: *Next );
Rsv Int(10) Inz(0);
END-DS;

Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Colpaert, Peter
Sent: Tuesday, May 27, 2014 7:13 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Free-format question

That was indeed what threw me off.

I remembered reading that overlay was not allowed, but I had forgotten the "on the DS itself" part.

Age is a b!tch...

Met vriendelijke groeten / Best regards,

Peter Colpaert
Software Engineer - PLM Development Team IT Operations Cluster Benelux, Philips IT

Philips Consumer Luminaires
Industrieterrein Satenrozen 11, 2550 Kontich, Belgium
Tel: (+32) 3/459 13 17
Email: Peter.Colpaert@xxxxxxxxxxx

Working from home on Wednesdays


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: dinsdag 27 mei 2014 13:07
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Free-format question

Yes, but POS cannot specify a subfield - that specified the position within the DS, so it can't specify a subfield and position - only position.

I wish that the list of keywords for free-form definitions would have included OVERLAY - the copy of the documentation I see in RDi does not.
Perhaps a newer version does.

Cheers
Vern

On 5/27/2014 5:57 AM, Colpaert, Peter wrote:
Hi Vern,

I tried the pos() keyword, but that didn't work. Probably because it's in integer.

But as Birgitta pointed out, apparently the overlay keyword IS allowed as long as you don't overlay the DS itself.

Met vriendelijke groeten / Best regards,

Peter Colpaert
Software Engineer - PLM Development Team IT Operations Cluster
Benelux, Philips IT

Philips Consumer Luminaires
Industrieterrein Satenrozen 11, 2550 Kontich, Belgium
Tel: (+32) 3/459 13 17
Email: Peter.Colpaert@xxxxxxxxxxx

Working from home on Wednesdays


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Vernon Hamberg
Sent: dinsdag 27 mei 2014 12:54
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Free-format question

Peter

Have you tried the POS keyword? That has a single parameter, the starting position within the DS.

The documentation that came out suggests that OVERLAY can be used as you have it here - but the list of keywords for free-form definitions doesn't include OVERLAY. I seem to recall Barbara saying something about this at a conference - but I could be remembering falsely.

At any rate, your first overlaid field is at position 2, so try POS(2), the second one, POS(3).

I would agree if you say that the documentation is confusing.

HTH
Vern

On 5/27/2014 4:20 AM, Colpaert, Peter wrote:
Hi group,

I've been busy converting a program with D-specs to full free-format, but I've encountered an issue which I cannot seem to solve.

Does anybody know how to convert this DS into a Decl-ds structure?

D DPA_Template_T Ds
D SclTyp 1a
D SclLen 5i 0
D DecPos 3i 0 Overlay( SclLen: 1 )
D DecLen 3i 0 Overlay( SclLen: 2 )
D Rsv 10i 0 Inz

The overlay of the subfield is giving me headaches.

Thanks in advance.

Met vriendelijke groeten / Best regards,

Peter Colpaert
Software Engineer - PLM Development Team IT Operations Cluster
Benelux, Philips IT

Philips Consumer Luminaires
Industrieterrein Satenrozen 11, 2550 Kontich, Belgium
Tel: (+32) 3/459 13 17
Email: Peter.Colpaert@xxxxxxxxxxx<mailto:Peter.Colpaert@xxxxxxxxxxx>

Working from home on Wednesdays


________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
--
This is the RPG programming on the IBM i (AS/400 and 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/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.



--
This is the RPG programming on the IBM i (AS/400 and 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/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.


--
This is the RPG programming on the IBM i (AS/400 and 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/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.