Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why File Status in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ashimprodhan

New User


Joined: 08 Dec 2006
Posts: 12
Location: Kolkata

PostPosted: Thu Apr 09, 2009 11:10 am    Post subject: Why File Status in COBOL
Reply with quote

Hi

I want to know one thing regarding file status. Sometimes if you dont define the file status associated with the file, the program runs fine. But I have seen that if you dont mention the file status it abends. After mentioning the file status clause it works fine again. Why this happens? Is it compiler/shop specific?

Thanks and Regards
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Thu Apr 09, 2009 12:24 pm    Post subject:
Reply with quote

Hi,
Quote:
After mentioning the file status clause it works fine again.
Well, this does not make any sense, can you please show the copile-listings or something which you think can prove this (Some one said that sychic day is Thrusday)

FILE STATUS is an optional clause the FILE-CONTROL paragraph. It monitors the execution of each input-output operation for the file.

When the FILE STATUS clause is specified, the system moves a value into the status key data item after each input-output operation that explicitly or implicitly refers to this file. The value indicates the status of execution of the statement.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 09, 2009 5:01 pm    Post subject:
Reply with quote

Quote:
But I have seen that if you dont mention the file status it abends. After mentioning the file status clause it works fine again.
If you have the file status code, possible abends can be intercepted and changed into non-zero file status codes. The program isn't working fine, it just is not abending -- there's still something wrong with the code that will eventually bite you because the file isn't being processed correctly, but there's no longer an abend generated.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Apr 09, 2009 8:47 pm    Post subject:
Reply with quote

Hello,

Quote:
After mentioning the file status clause it works fine again
The absence of an abend does not mean the program ran fine. It still failed and the code should detect the failure and cause a user abend or set some fatal condition code.

If the code is not going to properly detect and respond to invalid file status codes, it would be better to remove them and have the program abend immediately so the problems can be resolved long before the code is run in production.
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 Testing rerad cursor for status with ... John F Dutcher DB2 7 Fri May 19, 2017 9:35 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us