File status must be checked both while opening and reading
the file or only while reading the file?

Answers were Sorted based on User's Feedback



File status must be checked both while opening and reading the file or only while reading the file..

Answer / nagaraj ramamoorthy

As a good programming practice, it will be good if you
handle/include all possible error combination in the
program. so the file status must be checked in both cases.

Is This Answer Correct ?    8 Yes 0 No

File status must be checked both while opening and reading the file or only while reading the file..

Answer / raj

At the time of reading is enough. There is only one case of
getting abend at the time of opening i.e, If that file
doesn't exists.But in general the programmer doesn't open
any file if that one is not exists so there will be no
negative effect if we insert the File status check Opening
file.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More COBOL Interview Questions

How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

0 Answers  


Write a cobol program making use of the redefine clause.

0 Answers  


How to resolve the soc4 & soc7 other than following answers. Soc4 can resolved using mispleed dd name and dd name is not matching with file and soc7 check the sysdump and copy the offest address then correct it in the program.

10 Answers   ADP, Amdocs, Cap Gemini, Keane India Ltd, Super Value, TCS,


what is SYNCHRONIZATION?

3 Answers   Syntel,


If I want to increase the Limit in GDG. What should I do?

2 Answers   IBM,


What is the default value of DISP for temp datasets

5 Answers   IBM,


without performing any operations on a file how can i know whether it contains data or not

2 Answers  


how can we code index in an array of cobol pgm?

1 Answers   Wipro,


how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).

2 Answers   DELL, Mind Tree,


hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a record and if some condition is matched tat particular record must be deletd fom the ps

5 Answers   iNautix,


if you give cylinder(1,1)how many cylinders it will be allocate?

3 Answers   Hewitt,


input:-AABBCCDDEFGHIIJ output:- ABCDEFGHIJ Here in input we hav the duplicate characters i.e repeating characters.SO we should eliminate the duplicate characters and should display the output in ascending order.

6 Answers  


Categories