I want to read parallel 2 work files, but I don’t know, how does it works. If I use two interlaced READ Statements, I had to end the inner READ-Loop with END-WORK to make the next READ of the first Work File.
READ WORK FILE 01 #W01-SATZ
READ WORK FILE 02 #W02-SATZ
IF #W01-SATZ NE #W02-SATZ
In this kind, it does’nt work parallel! What can I do to read both Work-Files parallel? Perhaps it is easy, but I don’ have a good idea.
Thanks for your help!
Hi, I hope I can still add to this post.
When doing a Read Work File 02 Once, how do I continue looping?
I only want to select records that are on both files.
I tried to do escape top but that didn’t work.
READ WORK FILE 02 ONCE does not initiate a loop, so as you note, escape top does not work. If you need to skip a record in WF 2, you will need a repeat loop around the READ WORK FILE 02 ONCE statement and read one record at a time until you reach the end of file 2 or find a record to process.
The sequential match program that I referenced earlier in this thread is working code that demonstrates how to do what you want. It is a parent-to-child match, where WORK1 is the parent and WORK2 is the child. You can allow a 1:many match or restrict it to 1:1. Add your own logic for matches, widows (parent; no child), and orphans (child; no parent).