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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am

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