Posted: Wed Aug 12, 2009 6:25 am Post subject: File status 96 - S0C4
Hello,
I have encountered a strange situation, below are the details.
I am using a sequential file in a cobol program. I opened it in output mode. But in the JCL, there was no DD name coded. Just after the OPEN statement, I have displayed the file-status. When I executed the job it went fine giving MAXRC = 0. And the file-status displayed was 35.
In the next run, i have just added the file operation WRITE (excpet this nothing was changed) and submitted the job. This time the job abended with S0C4, but to my surprise the displayed file-status was 96.
If the program failed at the WRITE statement why the previous statement i.e. display of the file status got affected?
The code looks like this:
OPEN OUTPUT FILE1.
DISPLAY "FILE STATUS IS: ' FILE-STATUS1.
WRITE OUTPUT-RECORD1.
=====================
In the first run (there was no WRITE at this time, MAXRC = 0) the SYSOUT was
FILE STATUS IS: 35
In the second run (S0C4) it was
FILE STATUS IS: 96.
Can anybody explain me why the file status was changed from 35 to 96?
Joined: 26 Nov 2002 Posts: 12367 Topics: 75 Location: San Jose
Posted: Wed Aug 12, 2009 8:04 pm Post subject:
Temujin,
if you had looked up the file status codes you would have clearly understood the reason
file status 35 :
Code:
An OPEN operation with the I-O, INPUT, or EXTEND phrases has been tried on a non-OPTIONAL file that is not present. Trying to open a file that does not exist.
May need to map the COBOL file name to the physical file name. (Micro Focus, refer to the ASSIGN(EXTERNAL) directive)
File status 96 :
Code:
For VSAM under MVS: No DD statement specified for this file.
FOR VSAM and SAM under VSE: No DLBL statement specified for this file.
Cobol does not stop processing if a previous a error file status has occurred. It is the duty of the programmer to abend the job in case of bad file status code.
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