View previous topic :: View next topic
|
Author |
Message |
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
|