MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File status 96 - S0C4

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Temujin
Beginner


Joined: 19 Jun 2007
Posts: 13
Topics: 6

PostPosted: Wed Aug 12, 2009 6:25 am    Post subject: File status 96 - S0C4 Reply with quote

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?

Thanks,
Temu.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Wed Aug 12, 2009 8:04 pm    Post subject: Reply with quote

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.

Also I suggest that you look up the parm CBLQDA

http://www.mvsforums.com/helpboards/viewtopic.php?p=19998#19998
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group