View previous topic :: View next topic
|
Author |
Message |
aishvarya_82
New User
Joined: 11 Nov 2008 Posts: 11 Location: Pune
|
|
|
|
Hi,
I have one requirement in which I need to keep the last duplicate(if there is any) as well as all the unique records in a single file.My input is a single file and single output file.
What i have done is below :
SELECT FROM(SYSUT1) TO(SYSUT2) ON(1,3,CH) NODUPS
it is getting me all the unique records.I want to have the last duplicate as well in this sort card.
data sample:
aaa 230
aaa 120
bbb 200
ccc 500
bbb 200
o/p shud be :
aaa 120
bbb 200
ccc 500
Kindly suggest
Thanks , |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happened when You searched the forums with
keep last duplicate checking search for all terms
and clicked on the sixth topic returned ( the one with urgent ) (*)
To make the most out of the questions You ask it would be worth to read and meditate on
How To Ask Questions The Smart Way
here catb.org/~esr/faqs/smart-questions.html
(*) most probably You just did not care to do a bit of homework before posting |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
aishvarya_82,
You need to use the Parm LAST on select operator. Use the following DFSORT/ICETOOL JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
AAA 230
AAA 120
BBB 200
CCC 500
BBB 200
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) LAST
//* |
|
|
Back to top |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Hi,
can you tell me in what order the output is displayed.
Ideally if you are picking the last duplicate record then the output would have been as follows.
aaa 120
ccc 500
bbb 200
Do you want it in any specific order? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Elo,
I don't understand your question. Kolusu's job gives the output and order requested in the op's first post.
Quote: |
o/p should be :
aaa 120
bbb 200
ccc 500
|
|
|
Back to top |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Hi Frank,
That was a question I posted to aishvarya_82.
I wanted to know if she wanted the output to maintain the same order as that of input.
i.e
Input:
aaa 230
aaa 120
bbb 200
ccc 500
bbb 320
Output:
aaa 120
ccc 500
bbb 320
Since such a scenario was not taken into consideration,I wanted aishvarya_82 to clarify that. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
She did show the output she wanted in her first post as sorted - so I guess you're asking if she got it wrong and didn't realize it. |
|
Back to top |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Yes Frank you are right. |
|
Back to top |
|
|
|