Slight modification to what I sent before (mainly define the array lengths as the length of one of its elements from the file).

D ds_File DS LikeRec( FileRec )
D NumAry1 Dim( 24 ) Overlay( ds_File )
D Like( Numbers01A)
D NumAry2 Dim( 24 ) Overlay( ds_File: *next )
D Like( Numbers01B)
D NumAry3 Dim( 24 ) Overlay( ds_File: *next )
D Like( Numbers01C)

Read file ds_File;

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt Anderson
Sent: Thursday, June 25, 2009 4:09 PM
To: 'RPG programming on the IBM i / System i'
Subject: RE: Reading a file into a data set

Does this work?

D ds_File DS LikeRec( FileRec )
D NumAry1 5p 0 Dim( 24 ) Overlay( ds_File )
D NumAry2 5p 0 Dim( 24 ) Overlay( ds_File: *next )
D NumAry3 5p 0 Dim( 24 ) Overlay( ds_File: *next )

Read file ds_File;

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Thursday, June 25, 2009 3:18 PM
To: RPG programming on the IBM i / System i
Subject: Reading a file into a data set

Brain freeze on top of a brain fart really hurts
I'm sure that I've done this before, but I cannot remember how or in which
program

I have an externally defined file with the record consisting of the
following fields

Numbers01A 5 0
Numbers02A 5 0
Numbers03A 5 0
Numbers04A 5 0
Numbers05A 5 0
Numbers06A 5 0
Numbers07A 5 0
Numbers08A 5 0
Numbers09A 5 0
Numbers10A 5 0
Numbers11A 5 0
Numbers12A 5 0
Numbers13A 5 0
Numbers14A 5 0
Numbers15A 5 0
Numbers16A 5 0
Numbers17A 5 0
Numbers18A 5 0
Numbers19A 5 0
Numbers20A 5 0
Numbers21A 5 0
Numbers22A 5 0
Numbers23A 5 0
Numbers24A 5 0
Numbers01B 5 0
Numbers02B 5 0
Numbers03B 5 0
Numbers04B 5 0
Numbers05B 5 0
Numbers06B 5 0
Numbers07B 5 0
Numbers08B 5 0
Numbers09B 5 0
Numbers10B 5 0
Numbers11B 5 0
Numbers12B 5 0
Numbers13B 5 0
Numbers14B 5 0
Numbers15B 5 0
Numbers16B 5 0
Numbers17B 5 0
Numbers18B 5 0
Numbers19B 5 0
Numbers20B 5 0
Numbers21B 5 0
Numbers22B 5 0
Numbers23B 5 0
Numbers24B 5 0
Numbers01C 5 0
Numbers02C 5 0
Numbers03C 5 0
Numbers04C 5 0
Numbers05C 5 0
Numbers06C 5 0
Numbers07C 5 0
Numbers08C 5 0
Numbers09C 5 0
Numbers10C 5 0
Numbers11C 5 0
Numbers12C 5 0
Numbers13C 5 0
Numbers14C 5 0
Numbers15C 5 0
Numbers16C 5 0
Numbers17C 5 0
Numbers18C 5 0
Numbers19C 5 0
Numbers20C 5 0
Numbers21C 5 0
Numbers22C 5 0
Numbers23C 5 0
Numbers24C 5 0

Which in essence is 3 arrays of a 24 array
There is a way of reading this file into a 2 dimensional data set
(or am I getting COBOL flashbacks?)

Any help would be much appreciated (it would also show me that I'm not
getting senile)



Alan Shore
Programmer/Analyst, Distribution
E:AShore@xxxxxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill




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.