differnce between read work file 1 and read work file once?
why we are using work file once?

Answer Posted / satya

To answer why do we use READ WORK FILE 1 ONCE

It is generally used when you specifically want to know if
the input file is empty programatically and if you would
like to handle the way you wanted if the file is empty,just
like below,

READ work 1 ONCE #WORK
AT END OF FILE
Write "Input empty"
terminate 99
END-ENDFILE

this piece of code can be placed at the begining of your
program and this helps to avoid unnecessary entry into
programming statements with empty file in input, unless
expected

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain is it possible to code goto statement in natural? If yes please provide the syntax of the same?

762


Explain how to move cursor to a particular field when position is not known?

748


Tell me what type of files we can process thru file-aid?

715


What happens when you issue a escape routine in a program? Will there be any compilation /run time erro?

730


Suppose you are processing an input file in a natural program and you want the program to fail if the file is empty. What command you use in natural to force it to fail?

747


Explain how to receive data passed through jcl parm parameter in a natural program? How data definition is defined in the program?

804


How to find occurrence of mu and pe fields in a file?

651


Explain why do we use file-aid for seqential files?

752


Explain the address converter?

743


Explain difference between read(1) and read work file once?

713


Explain difference between read work file 1 and read work file once? Why we are using work file once?

729


What is cobol coding sheet?

883


How to receive data passed through jcl parm parameter in a natural program?

736


How to create 1 ddm that fetches 3 adabas files simultaneously?

706


Explain the data storage?

748