Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we find out duplicate record in single file using JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can we find out duplicate record in single file using JCL
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    Post subject:
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: 182
Location: hyderabad

PostPosted: Tue Mar 13, 2007 5:37 pm    Post subject:
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 Moderator


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

PostPosted: Tue Mar 13, 2007 9:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us