View previous topic :: View next topic
|
Author |
Message |
asingh786
New User
Joined: 15 Oct 2008 Posts: 2 Location: NewYork
|
|
|
|
Hi,
I'm new to Easytrieve. I'm getting A010 INVALID FILE REFERENCE - SYSUT3 in my code below. I searched this forum for my error but nothing useful for me.
I'm using 3 files, SUSUT1,SYSUT3 as input and SYSUT2 as output.
I dont want to use IF MATCHED logic so please suggest something in this code. Thanks!
Code: |
JOB INPUT NULL
*
INIT-UT1
GET SYSUT1
IF EOF SYSUT1
STOP
END-IF
*
IND = 31
IF SMP-FUND EQ 'XYZ'
PERFORM READ-UT3
DO WHILE IND > 0
IF SMP-DAY(IND) EQ '1'
SMP-PRICE(IND) = NEW-PRC
END-IF
IND = IND - 1
END-DO
PUT SYSUT2 FROM SYSUT1
ELSE
PUT SYSUT2 FROM SYSUT1
END-IF
*
GOTO INIT-UT1
*********************
READ-UT3. PROC
GET-UT3
*
GET SYSUT3 <-- A010 INVALID FILE REFERENCE - SYSUT3
IF EOF SYSUT3
GOTO END-UT3
END-IF
IND3 = IND3 + 1
GOTO GET-UT3
*
END-UT3
END-PROC |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
You have not posted enough of the code. . . How is SYSUT3 deifned?
If you have 2 files sorted by the same key, why would you prefer not to use MATCHED? If the files do not have the same key in the same sequence, MATCHED won't work so should not be a matter pf preference.
Please use the "Code" tag when posting code, jcl, data, etc that need alighment preserved. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Make sure SYSUT3 contains records...
O. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And that you don't read SYSUT3 "again" after end of file. . . |
|
Back to top |
|
|
asingh786
New User
Joined: 15 Oct 2008 Posts: 2 Location: NewYork
|
|
|
|
Thanks for your responce guys.
Is there any way to close SYSUT3 and open it again because I've to read it again and again. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
The Truth Is Out There. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I've to read it again and again. |
I have heard that again and again. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Reading a file over and over again is not recommended. A table kept in memory would be much faster. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Is there any way to close SYSUT3 and open it again because I've to read it again and again. |
Only by choice. . . It is surely not a business requirement.
If you post what you really want to accomplish, someone may have a suggestion. You need to post the particulars of your requirement.
Opening/Closing a file many times to prevent doing a bit of actual coding is almost always not acceptable. . . |
|
Back to top |
|
|
|