View previous topic :: View next topic |
Author |
Message |
shash_modi Beginner
Joined: 22 Apr 2008 Posts: 26 Topics: 9 Location: Mumbai
|
Posted: Fri Jul 30, 2010 4:23 am Post subject: SORT and to copy only last duplicate |
|
|
I want to SORT the file and to copy the last duplicate only. For example my input file is as follows:
Input File:
------------
111 A
111 B
222 B
222 C
My output file should look like:
-----------------------------------
111 B
222 C
How we can achieve the above result using SORT? |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Jul 30, 2010 9:37 am Post subject: |
|
|
Look in the DFSORT manuals under ICETOOL chapter AND SELECT which has a LASTDUP option. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Jul 30, 2010 10:25 am Post subject: |
|
|
shash_modi,
The following DFSORT/ICETOOL JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
111 A
111 B
222 B
222 C
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) LASTDUP
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|