Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
ap,
It's not clear what you're trying to do, but whatever it is, you have things set up wrong. The reason you don't get a 1100500000995510 record is the use of WITHEACH. After the records are sorted on 1,16,CH but before they are spliced, you have this for those three records:
With WITHEACH WITH(66,2), the WITH field from the second record is spliced into the first record giving 11. Since you only have one WITH field, the third record is ignored. So all you get from SPLICE for these three records is:
Code:
1100500000995510 440.00 11
You then delete this record with the OUTFIL INCLUDE for '12'.
You'd then delete the first record and keep the second record with the OUTFIL INCLUDE for '12'.
I have no idea if that's what you want, since you haven't told us what output you're trying to get or the rules for getting it.
Also, you should be using WITH(65,1) rather than WITH(66,2) although that won't affect the output.
Let me know what you're trying to do, preferably with a good example of input and output records including matching and non-matching cases, and I'll show you how to do it correctly.