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



Hi Dan
Understand what you are saying - but if we have to change the size of a field within the file - that would need to be tested and validated anyway
So in that respect, I have no problem with the solution

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan
Sent: Tuesday, June 12, 2018 3:04 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: [EXTERNAL] RE: File having an array using new free form

Personally, if I understand Dave's solution correctly, I like his better.
With the solution you're using, you are relying on field Camtday01 starting in position 97 forever. What happens if you ever change the length of a field in this record before Camtday01? The program will recompile just fine, but will likely bomb once you run it because it is expecting your array to start in position 97 but it doesn't anymore. If you're really unlucky, it won't bomb, but will give bad results that you might not recognize until it's too late.

With Dave's solution, again if I understand it correctly, you don't have to rely on Camtday01 starting in position 97. Instead, it will use the address of Camtday01 as the starting point, no matter where it is actually located in the record.

- Dan

On Tue, Jun 12, 2018 at 2:36 PM, Alan Shore <ashore@xxxxxxxx> wrote:

WOWWWWW
Thanks Birgitta - I believe I have it
Well - I mean - there are no compile errors

OMG - that was a struggle

This is what I ended up with


I have the external file defined

dcl-f Chnlanalp usage(*output:*update) keyed prefix('CHA.');

Then it is qualified later

dcl-ds CHA Extname('CHNLANALP') qualified;
Arr Like(CHA.Camtday01) Dim(32) Pos(97);
end-ds;

Where the field Camtday01 starts in position 97 in the record

The proof of the pudding will be in the testing

Fingers (and anything else) crossed

Appreciate all the responses

--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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.