View previous topic :: View next topic
|
Author |
Message |
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Hi,
My requirement is to retain the unique records in a file, not just removing the more than one occurence of record.
My input would be like
Code: |
aaaa
aaaa
bbbb
cccc
ffffff
|
and would like to have the output file as
could some one please explain me how to do that using a syncsort job.
Thanks!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
aaaa
aaaa
bbbb
cccc
ffffff
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,10,CH) NODUPS
/*
|
|
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is a SyncSort for z/OS job that will produce the requested output:
Code: |
//SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
AAAA
AAAA
BBBB
CCCC
FFFFFF
//SYSIN DD *
INREC FIELDS=(1:C'001',1,80)
SORT FIELDS=(4,6,CH,A),EQUALS
SUM FIELDS=(1,3,ZD)
OUTFIL OUTREC=(1:4,80),INCLUDE=(1,3,CH,EQ,C'001')
/* |
|
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thank you so much frank and Alissa !!, it was helpful. |
|
Back to top |
|
|
|