Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You have the WITH fields wrong. The WITH fields indicate the bytes you want from the overlay (second) record. So WITH(10,2) WITH(15,2) gives you bytes 10-11 and 15-16 from the overlay record - for the first pair of records, that's 91 and 77. You actually want bytes 10-11 and 15-16 from the base (first) record.
You essentially want to keep the entire base record each time you have a match. To do that, you can use WITH(1,6) so bytes 1-6 will be taken from the overlay (second) record and bytes 10-11 and 15-16 will be taken from the base (first) record. So your SPLICE statement should be:
I'd suggest reading through the SPLICE documentation again paying particular attention to the concept of the base record and overlay record.
You can find the DFSORT SPLICE doc at:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
(Since you said "rest of the data should not change, it should remain as it is", I'm assuming you really don't want to drop the fourth field shown in your input file, but not in your output file.)
Did you read what I said about the base and overlay records?
Use a WITH operand for any fields you want from the overlay (second) record. For example, if you want positions 19-26 from the overlay record, add WITH(19,8). If you want positions 19-80 from the overlay record, add WITH(19,62). Just figure out what positions you need from the overlay record and add an appropriate WITH operand for them.
And please, the next time you want to know how to do something, describe what you want to do in detail. It's very frustrating, when you say "I want to do this" and I show you how, and then you say "but I really wanted to do that and you only showed me how to do this". I can't read your mind.