Need to find duplicate records in JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Need to find duplicate records in JCL

Postby vishnusrini » Wed Jan 21, 2015 5:27 pm

I have a file which looks like this.

File1
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 SANDIPXXXXXXXXXXXX02XXXXXXXXXXXXXXXXX
000002 SANDIPXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000003 SUDHASXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000004 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000005 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000006 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000007 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
****** **************************** Bottom of Data ****************************

From this file I need to find the duplicate record and the key is from 1 of 6 char (i.e. 1-6)
And I want to check whether in the selected duplicate records the value in clos 19-20 (2 char) is same or not.

Output1
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000004 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000005 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000006 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000007 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
****** **************************** Bottom of Data ****************************

If you see, there are the occurance of sandip in the input file, but the value in 19-20 is differenct, so i dont whan this file. this file should be moved to other output file

Output2
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 SANDIPXXXXXXXXXXXX02XXXXXXXXXXXXXXXXX
000002 SANDIPXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
****** **************************** Bottom of Data ****************************

Some one help me to do this process in JCL.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Need to find duplicate records in JCL

 

Re: Need to find duplicate records in JCL

Postby BillyBoyo » Wed Jan 21, 2015 5:52 pm

Can there only be two records with duplicate keys, or can there be more?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need to find duplicate records in JCL

Postby vishnusrini » Wed Jan 21, 2015 6:31 pm

There are possible to have more duplicate records, i.e. more then 2 duplicate records.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Need to find duplicate records in JCL

Postby Terry Heinze » Wed Jan 21, 2015 8:06 pm

vishnusrini,
In the future, please use Code tags. You can read about them by clicking on the BBCode link in FAQ. Code tags are available when clicking Post a Reply but not Quick Reply.
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 SANDIPXXXXXXXXXXXX02XXXXXXXXXXXXXXXXX
000002 SANDIPXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000003 SUDHASXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000004 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000005 TANIYAXXXXXXXXXXXX03XXXXXXXXXXXXXXXXX
000006 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
000007 VISHNUXXXXXXXXXXXX01XXXXXXXXXXXXXXXXX
****** **************************** Bottom of Data ****************************

.... Terry
Terry Heinze
 
Posts: 193
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: Need to find duplicate records in JCL

Postby vishnusrini » Wed Jan 21, 2015 8:39 pm

Sure, in future i will post using Code tags.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Need to find duplicate records in JCL

Postby vishnusrini » Thu Jan 22, 2015 3:49 pm

Do any one know the solution for my issue, please advice me.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Need to find duplicate records in JCL

Postby BillyBoyo » Thu Jan 22, 2015 5:56 pm

You need a better description and sample data which is representative of your actual possible data, showing the records with more than two being duplicate and with and without the different values. Can some values be the same within a key, and others different, for instance. If so, what then?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need to find duplicate records in JCL

Postby NicC » Fri Jan 23, 2015 3:17 am

Please learn to post in the correct part of the forum. JCL cannot do anything with data - it simply telss the OS what program(s) you want to execute and the resources required. If you were wanting a sort solution then please state this and which sort product you use so that the topic can be moved to the correct part of the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post