Page 1 of 1

File status Check while Writing into a Sequential file

PostPosted: Thu Apr 06, 2017 4:46 pm
by Shanthi_Palani
Hello Experts,
Greetings.
I have a doubt with the file status checking while writing into a sequential file. Is it not mandatory?
I was with the mindset that all the I/O operation's exceptions are to be handled and the program control has to flow accordingly.
But recently I was analyzing a lot of legacy applications where none of the write verbs' file status were checked. Initially I thought it might have been a miss, but since no where it was handled I think now that, there might be a chance that it was done intentionally.

Kindly will you confirm whether we get any positivity by doing so. I couldn't reach any of the application developers.

I apologize if you find this question as dumb.

Thanks a ton!

Re: File status Check while Writing into a Sequential file

PostPosted: Thu Apr 06, 2017 5:09 pm
by Robert Sample
Is it not mandatory?
No, checking the file status is ALWAYS optional. COBOL and system z have various ways to indicate a problem with data set access and checking the file status is merely one of those ways. And, depending upon the age of the legacy code, it is entirely possible that they were written before COBOL supported file status codes at all. So the lack of file status code checking could have been deliberate, or it could have been because the mechanism didn't exist when the code was developed.