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
 
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: 8165
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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