IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we find out duplicate record in single file using JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sadashiv.a.bhosure

New User


Joined: 01 Feb 2007
Posts: 15
Location: india

PostPosted: Tue Mar 13, 2007 11:30 am
Reply with quote

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
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Tue Mar 13, 2007 2:06 pm
Reply with quote

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
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Mar 13, 2007 5:37 pm
Reply with quote

Hi,

You can also use the SELECT command available with diffrent options.
check the manual for more details.

Thanks
Krishy
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 13, 2007 9:50 pm
Reply with quote

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:

Code:

aaaa
bbbb
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top