IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File status 46


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohitvw

New User


Joined: 04 Feb 2009
Posts: 12
Location: Chennai

PostPosted: Thu Aug 13, 2009 6:26 pm
Reply with quote

Below code sometimes failing with vsam return code 46 and running fine with same data when i rerun it, can some one please help

Code:
READ FILE-NAME NEXT                                           
    AT END MOVE "Y"             TO WS-EOF-FILE-NAME.       
IF  WS-FILE-STATUS-GOOD OR WS-FILE-STATUS-EOF               
     IF  WS-FILE-STATUS-EOF                                   
         SET EOF-FILE-NAME          TO TRUE                     
         GO TO EXIT                                     
     END-IF                                                   
ELSE                                                         
    DISPLAY "ERROR READING FILE-NAME STATUS CODE:" WS-FILE- STATUS
    MOVE 16                      TO RETURN-CODE               
    GO TO EXIT                                           
END-IF.   
Code'd

In above code file status good means 0,5 and 97
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 13, 2009 7:06 pm
Reply with quote

Go to the COBOL forum, and near the top of the topics list will be a link to the manual that explains the status codes.
Back to top
View user's profile Send private message
rohitvw

New User


Joined: 04 Feb 2009
Posts: 12
Location: Chennai

PostPosted: Thu Aug 13, 2009 7:19 pm
Reply with quote

Thanks for your quick respopnse, I know the meaning of file status 46 (failing while reading the file sequentially), hence I pasted my code also.

My code is failing rarely with file status 46, but i am unable to track why it failing, even I rerun the program the with same data in file it is not failing again, Can you please suggest, if something is wrong in my code thanks.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Aug 13, 2009 7:35 pm
Reply with quote

We can't answer that given only the code you posted. Are you checking the FILE STATUS after every I/O on your file? Opens, closes, reads, writes, etc.? I suspect you are attempting to read beyond end of file, but we can't tell from the code posted. Please use BBCode (see FAQ) for readability.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top