Hmm ... it's not very clear what you want to do and your example isn't a very good one considering that SUM FIELDS=NONE will give you the first record and delete the second record which would give you the results you're asking for. I think you want to extract just the duplicate records and then delete the ones with 'Bad'. For example, if the input is:
your understanding abt my problem is correct. Let me be more clear on this.
I am merging two files (File1 & File2) and then sorted the output(OutFile) on the key. File2 records contains a particular word (lets say BAD) for all the records. If the OutFile contains duplicates, then I need to delete only the records which contain the word 'BAD'.
I want to place this logic in a Proc.
Please try and help me on this.
I don't understand what you want. For the situation where you're not getting what you want, please show me an example of your input records, the output records you're getting with my job and the output records you want.
It's really difficult to help you when you don't give the details of what you want. Your original post just showed dups for input with no mention of nodups. I showed an example with dups and nodups for input and just the dups for output. You didn't say that's not what you wanted. Now you say you want nodups, but you don't show any example of what you want.
I can't read your mind. Please help me help you by giving complete details of what you want.