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: 7935
Location: Bellevue, IA

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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


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