Thread: General

Need to re-read a sequential file mid Easytrieve JOB

Started by Lisa • user4 replies194 viewsLast activity 2 weeks ago
Post #1
0 votes
Lisa
Reputation
96
Posts: 17
Joined: Jun 20, 2025, 1:40 PM
Posted: Jul 27, 2026, 9:23 AM

Program walks FILE2 until a section marker, then needs to walk FILE1 from the top again for each marker. First pass works. Second pass A010 because FILE1 is already at EOF.

Can you CLOSE and reopen in Easytrieve, or am I stuck with three DDs pointing at the same DSN?

Post #2
0 votes
James
Reputation
524
Posts: 30
Joined: May 2, 2024, 8:00 AM
Posted: Jul 27, 2026, 12:23 PM

On 11.x there is CLOSE. JOB INPUT NULL, GET until EOF, CLOSE file, GET again. Does not work on old 6.x / compatibility mode.

Otherwise load FILE1 into an OCCURS table once and reuse it. Multiple DDs to the same DSN works but looks ugly in reviews.

Post #3
1 votes
Anita
Reputation
118
Posts: 23
Joined: May 29, 2025, 12:45 PM
Posted: Jul 27, 2026, 5:23 PM

We went the array route. Student guide examples only show JanFebMar packed into one string so I thought arrays were useless for records. Coworker showed OCCURS of a record layout. That was the missing piece.

Post #4
0 votes
Lisa
Reputation
96
Posts: 17
Joined: Jun 20, 2025, 1:40 PM
Posted: Jul 29, 2026, 11:23 AM

Loaded the table. Way cleaner than three DDs. Thanks.

You must be signed in to reply to this thread