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

wht is packed decimal in cobol

2 Answers  


can we read records in a file from botom to top. if possible how can we read

12 Answers   ACS,


What are the functions like c or c++ in cobol?

2 Answers  


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

0 Answers  


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

0 Answers  






Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?

1 Answers  


can internal sort be applied to sort ksds files?

1 Answers  


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,


How to convert bunch of words in a line to relvant ASCII values?

2 Answers  


what is the difference between PA & PF keys?

1 Answers   IBM,


What is static and dynamic call in cobol?

0 Answers  


which one is better among static call and dynamic call?

3 Answers  


Categories