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

here is my compile and link edit steps in a jcl //COMPILE1 JOB (3CUS,S),'CCDM TEST' //STEPNAME EXEC PGM=IGYCRCTL,PARM='DYNAM,RENT,LIB,OBJECT, // OFFSET,APOST,OPTIMIZE',REGION=4096K //STEPLIB DD DSNAME=PM7351.TEST2.COB,DISP=SHR //SYSIN DD DSNAME=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT2 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT3 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT4 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT5 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT6 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT7 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSPRINT DD SYSOUT=* //SYSLIN DD DSNAME=&&LOAD,DISP=(MOD,PASS),UNIT=SYSDA, // SPACE=(10,(10,10)),DCB=BLKSIZE=400 //LKED EXEC PGM=IEWL,REGION=1024K //SYSPRINT DD SYSOUT=A //SYSLIB DD DSN=PM7351.TEST2.LOADLIB,DISP=SHR // DD DSN=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSLMOD DD DSN=PM7351.TEST2.LOADLIB, // DISP=SHR //SYSUT1 DD UNIT=SYSDA,DCB=BLKSIZE=1024,SPACE=(CYL,(1,1)) //SYSTERM DD SYSOUT=* //SYSLIN DD DSN=&&LOAD,DISP=(OLD,DELETE) //SYSIN DD DUMMY i am getting IEW2013I 0F08 NO MEMBER NAME WAS SPECIFIED. MODULE WAS SAVED USING TEMPNAM1. could any one tell me the resolution for this..?

1 Answers  


how to run sub programs using static and dynamic call ...

3 Answers   TCS,


01 A pic 9(100) find record length of it

6 Answers   TCS,


how to pass 100 to s9(4) how r they inserted ?

3 Answers   TCS,


What are the different data types in cobol?

0 Answers  






in the TIME parameter we r giving hours r minutes

4 Answers   IBM,


What is cobol?

0 Answers  


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

2 Answers  


What are various search techniques in cobol? Explain.

0 Answers  


) what is the difference between AID and HANDLE AID?

0 Answers   IBM,


how do you reference the printer file formats from cobol programs

0 Answers  


How can we know that cobol program is using report file or simple file....?

4 Answers  


Categories