Frank, again thanks for the assistance. I think I know how this works but in your own words, could you please explain the workings of the stmts.
No rush. I know you're a busy guy constantly juggling and managing your time. btw, You can PM me the answer if you like.
The first COPY operator creates this OMIT statement in the CTL2CNTL data set. It uses an OUTFIL statement in CTL1CNTL to do it as follows:
HEADER1 - creates the first line of the OMIT statement.
BUILD - creates a line for each constant in file1.
TRAILER1 - creates the last line of the OMIT statement.
The second COPY operator uses the OMIT statement in CTL2CNTL against input file2.
Thank you. what about 1,1,NE,11 in the header and trailer?
How are records from IN1 written one by one into CTL2?
How are records in IN1 compared to records in CTL2, and matched records filtered out?
As you can tell Im not a heavy SORT user but Im having real interest in this, I should read up on it more. Quite powerful. I can see using it here more often..I'd have to look around our installation & applications that can benefit from this.
Again no rush. Reply whenever you find time.. thanks
It's easier to use a NOP for the first line and last line then to do the coding to put real constants into those lines. So I use 1,1,NE,1,1 for line1 and linen, and the real constants for the other lines. 1,1,NE,1,1 can never be true, so it has no effect on the records omitted - it's a NOP. Just a trick.
Quote:
How are records from IN1 written one by one into CTL2?
HEADER1 writes an output line before the detail lines.
BUILD writes one output line (detail line) for each record in IN1.
TRAILER1 writes an output line after the detail lines.
Quote:
How are records in IN1 compared to records in CTL2, and matched records filtered out?
I assume you mean IN2 here, not IN1. It's the records in IN2 we want to do the compare against - right? For the second COPY operator, USING(CTL2) tells DFSORT to use the DFSORT statements in CTL2CNTL against the input from IN2. CTL2CNTL has the OMIT statement, so the OMIT is evaluated for each IN2 record.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: