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
What is a hyperdescriptor? How does it work?
Explain adabas basic concepts. Like inverted list, address converter ,data storage?
Explain how to receive data passed through jcl parm parameter in a natural program? How data definition is defined in the program?
Explain how many work file we can code in jcl?
Explain control variable in online screens?
Explain how are you going to remove duplicates from the file that is being read?
Explain the data storage?
Explain how to move cursor to a particular field when position is not known?
What is the difference between read(1) and read work file once?
Tell me can we update with histogram?
How can we see the copy book length using file-aid?
What is the difference between escape(top or bottom) and escape immediate(top or bottom?
The natural file converted to PDF file if Yes then explain ?
How to create 1 ddm that fetches 3 adabas files simultaneously?
What happens when you issue a escape routine in a program? Will there be any compilation /run time erro?