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

Why File Status in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Thu Apr 09, 2009 12:24 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 09, 2009 5:01 pm
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

Moderator Emeritus


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

PostPosted: Thu Apr 09, 2009 8:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top