MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File Status 46 and U4039

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Dec 14, 2005 5:13 am    Post subject: File Status 46 and U4039 Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Dec 14, 2005 5:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Dec 14, 2005 5:50 am    Post subject: Reply with quote

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
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Dec 14, 2005 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Dec 14, 2005 6:34 am    Post subject: Reply with quote

Sorry Kolusu, I have done some changes.
Now as you said 'END OF FILE REACHED' is displayed once.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Dec 14, 2005 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Dec 14, 2005 7:59 am    Post subject: Reply with quote

ok. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group