View previous topic :: View next topic
|
Author |
Message |
ujangala
New User
Joined: 17 Oct 2006 Posts: 3 Location: Hyd, India
|
|
|
|
Frnds,
Can someone help me with this issue.
I want to delete a duplicate record which is having particular value at desired location. For example.....
01keyThisisaGoodrecord.
01keyThisisaBad record.
In the above two records, the key (1-5) is same, I need to delete the second record which is having 'Bad' in that position.
I used SUM FIELDS=NONE. This always keeps FIRST record, which is not serving my purpose.
Please help me. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
00keyThisisaGoodrecord.
01keyThisisaGoodrecord.
01keyThisisaBad record.
02keyThisisaBad record.
02keyThisisaGood record.
You'd want the output to be:
01keyThisisaGoodrecord.
02keyThisisaGood record.
If that's what you want to do, then you can use this DFSORT/ICETOOL job:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,5,CH) ALLDUPS USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,OMIT=(13,3,CH,EQ,C'Bad')
/*
|
If that's not what you want to do, then you need to explain more clearly what you want to do and show a better example of your input records and what you want for the output records. |
|
Back to top |
|
|
ujangala
New User
Joined: 17 Oct 2006 Posts: 3 Location: Hyd, India
|
|
|
|
Hi Frank,
Thanks for your reply.
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.
Thanks, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
your understanding abt my problem is correct.
Please try and help me on this. |
If my understanding is correct, then I already gave you a DFSORT job to do what you want to do. So what further help are you requesting? |
|
Back to top |
|
|
ujangala
New User
Joined: 17 Oct 2006 Posts: 3 Location: Hyd, India
|
|
|
|
Thanks for your solution.
With this logic, I am getting only the records which have dups. But I also need nondup records in my output.
Now I am doing it in two steps using ALLDUPS and NODUPS, and then merging the two outputs.
Please tell me if there is any other way to do it.
Also Thanks for guiding me on this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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. |
|
Back to top |
|
|
|