Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 183
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us