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

Answer Posted / kevin

As NIKI stated the read work file 1 is identifying the work
file in JLC

As for the work read work file once it is used to get the
next record. The record pointer doesn't get reset allow
you to process records from 2 files one at at time.

For example if you are comparing record from 2 work files
and processing the records in order


read work a once /* reads the first a record
read work b once /* reads the second b record

REPEAT
IF rec-a > rec-b
process b ...
read work b once
escape top
End-if
IF rec-a < rec-b
process a ...
read work a once
ecape top
End-if
If rec-a = rec-b
process a and b ...
read work a once
read work b once
end-if
end-repeat

(of course you would need escape logic in the loop such as
end of file logic...)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain difference between escape(top or bottom) and escape immediate(top or bottom?

835


Explain adabas basic concepts. Like inverted list, address converter ,data storage?

747


Explain the address converter?

743


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

752


Explain the data storage?

748


Define cobol coding sheet?

721


Tell me can we update with histogram?

785


What is a hyperdescriptor? How does it work?

792


What is cobol coding sheet?

883


Explain the difference between external subroutine and subprogram?

838


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

729


What is the difference between read work file 1 and read work file once? Why we are using work file once?

724


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


What is data trace system 2.0 used for?

5368


What is a hyperdescriptor?

695