IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Confusion on file operations


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chintu687

New User


Joined: 06 Aug 2009
Posts: 7
Location: Hyderabad

PostPosted: Wed Aug 12, 2009 11:38 am
Reply with quote

I am using an output file in a program, i opened it in output mode and displayed the file status. I did not mention the DD name in the JCL and submitted the job.

The job got executed successfully and the file status displayed was 35.

Now i have coded WRITE statement for the same file and executed the job. Now the job abended with S0C4 and the file status displayed was 96.

Here I have displayed the file status before the WRITE statement.
If the program failed at WRITE statement then the file status should be 35 and abended. But it displayed 96 and abended.

Why the file status has been changed from 35 to 96 even before executing the WRITE statement?

Can somebody explain what happend in the background.


Thank you,
chintu
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Aug 12, 2009 12:21 pm
Reply with quote

Hi Chintu,

Welcome to the forum... icon_wink.gif

Did u go through COBOL file status codes. What did they tell you ?

For your Reference
COBOL File Status

Please do look into this and do post us back if you still haven't understood your problem...
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Aug 12, 2009 1:46 pm
Reply with quote

wow - I thought web pages with colours that horrible were outlawed in the 1980s after www.webpagesthatsuck.com first came out.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 12, 2009 4:35 pm
Reply with quote

Quote:
Can somebody explain what happend in the background.
Since you did not provide any code, all we can do is guess, not explain. One possibility is that you attempted to use the buffer or its fields (the 01 level under the FD) which won't work when you get a 35 file status upon OPEN.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Aug 12, 2009 4:52 pm
Reply with quote

Quote:
If the program failed at WRITE statement then the file status should be 35 and abended
From an application programmer point of view, with WRTIE command, sytem assumes, file must be OPENed in OUTPUT, I-O or EXTEND mode (please NOTE: input mode is not included which will casue status 35) so with WRITE you get Status code 96 which means an OPEN statement with I-O or EXTEND phrase was attempted for an optional file, but no DD statement was specified for the file. And this is exactly what your case is.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 12, 2009 5:51 pm
Reply with quote

this same question is posted in another forum (by a member who swears that this thread is not his).

therefore, this is a classroom exercise.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Aug 12, 2009 5:57 pm
Reply with quote

interesting.... icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top