View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Dec 14, 2005 5:13 am Post subject: File Status 46 and U4039 |
|
|
I am getting the following message when I tried to read a sequential file.This is happening when I try to read the last record.
FILE STATUS nor a declarative was specified for file TOTLE
ve location X'2A2E'. The status code was 46.
I see that the reason
Reason: ATTEMPT TO READ THE NEXT NONEXISTENT RECORD
A sequential READ statement was attempted on a file open in the input or I-O mode and no valid next record had been established because: 1. The preceding START statement was unsuccessful, or 2.The preceding READ statement was unsuccessful but did not cause an at end condition, or 3. The preceding READ statement caused an at end condition.
Any Help is appreciated. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Dec 14, 2005 5:43 am Post subject: |
|
|
vak255,
Your pgm might have reached the EOF condition in the prior read itself. Change your Read statement as follows and see how many times the "end of file reached" text is displayed in sysout.
Code: |
READ xxxxx
AT END
DISPLAY 'END OF FILE REACHED'
END-READ
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Dec 14, 2005 5:50 am Post subject: |
|
|
Yes, kolusu. you are right End of file is set at last record and for some reason pgm tries to read again and pgm gets abended.
could you please help me to override this error. |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Dec 14, 2005 6:29 am Post subject: |
|
|
kolusu,
'END OF FILE REACHED' is not displayed even once in sysout.
But EOF flag is set in another para.
Any Help. |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Dec 14, 2005 6:34 am Post subject: |
|
|
Sorry Kolusu, I have done some changes.
Now as you said 'END OF FILE REACHED' is displayed once. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Dec 14, 2005 7:54 am Post subject: |
|
|
vak255,
Checking for EOF condition and handling it is a very basic step in programming. So check your program flow for the read file and make sure that you are not reading beyond the EOF.
I cannot help to fix the problem unless I see the code.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Wed Dec 14, 2005 7:59 am Post subject: |
|
|
ok. Thanks. |
|
Back to top |
|
|
|
|