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



It should work - as long as you can count! - but I prefer the solution I offered on the Midrange list and Birgitta has offered here.

Using Pos values of anything other than 1 - other than on things like the PSDS - is risky. This program will break big time with a change in field length of any of the fields in the first 96 bytes.

Repeat after me - hard coding bad - soft coding good!


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jun 12, 2018, at 7: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


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 Birgitta Hauser
Sent: Tuesday, June 12, 2018 1:59 PM
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxx>
Subject: [EXTERNAL] RE: File having an array using new free form

Define a Data Structure, list all the file fields as subfield and overlay it with an array:

DCL-DS YourDatastructure
FileFld1;
FileFld2;
FileFld3;
...
FileFld32;
Arr Like(FileFld1) Dim(32) Pos(1);



Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to." (Richard Branson)


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> On Behalf Of Alan Shore
Sent: Dienstag, 12. Juni 2018 19:40
To: rpg400-l@xxxxxxxxxxxx
Subject: File having an array using new free form

Hi everyone
Before I forget - we are on V7r1
I have also posted this question on the Midrange Systems Technical Discussion side

Here is my situation - hope that it makes sense

I have defined a file where the last 32 fields on the record are all the same size Fields 1 through 31 represent the day of the month, with field 32 being the total of fields 1 through 31

How can I define these fields within my program (using new free-form) so that these 32 fields are an array That way, I can use the day of the month to determine which occurrence I need to deal with

Like I said - I hope my question makes sense

As always - all answers gratefully accepted

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

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

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

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

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