Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Confusion on file operations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Confusion on file operations
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    Post subject:
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: 401
Location: Mumbai

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

wow - I thought web pages with colours that horrible were outlawed in the 1980s after http://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: 8152
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 12, 2009 4:35 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Aug 12, 2009 4:52 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Aug 12, 2009 5:51 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us