View previous topic :: View next topic
|
Author |
Message |
sadashiv.a.bhosure
New User
Joined: 01 Feb 2007 Posts: 15 Location: india
|
|
|
|
Hi,
Can we find out duplicate record in single file using JCL.
for ex.
file1 contain
aaaa
bbbb
aaaa
aaaa
can we find out there is 2 duplicate record using jcl.
also can we create o/p as
output file
aaaa
bbbb
Can we handle this without writing COBOL program.
waiting for rply.......
Thanks in Advance
Sadashiv. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi
In Sort we can find the Duplicate Records,
For Ex you want to eliminate the records based upon the first four position then use the below sort card in the JCL
Code: |
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=NONE
|
Sai |
|
Back to top |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Hi,
You can also use the SELECT command available with diffrent options.
check the manual for more details.
Thanks
Krishy |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sadashiv,
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
aaaa
bbbb
aaaa
aaaa
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
UNIQUE FROM(IN) ON(1,4,CH)
SELECT FROM(IN) TO(OUT) ON(1,4,CH) FIRST
/*
|
UNIQUE will display the count of the unique keys in TOOLMSG, e.g.
Code: |
ICE610I 0 NUMBER OF UNIQUE VALUES FOR (1,4,CH) : 000000000000002
|
SELECT will write the first record with each unique key to the OUT data set:
|
|
Back to top |
|
|
|