Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File status 46

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
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    Post subject: File status 46
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: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 13, 2009 7:06 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us