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
 

 

Merging two records with the same key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Wed Jun 10, 2009 9:21 pm    Post subject: Merging two records with the same key
Reply with quote

Hi Friends,

Could you please help me to merge these records using SORT...or any of the IBM utilities.....

My input file is.....
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0205  5655G53  5655G53  34.01  2009/145               
ABCD0205                                     PQRS000156 
ABCD0210  5655G53  5655G53  34.01  2009/145                 
ABCD0210                                     PQRS000046 
ABCD0260  5655G53  5655G53  34.01  2009/132               
ABCD0260                                     PQRS000169 
----+----1----+----2----+----3----+----4----+----5----+----6

and i need the output file like this....
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0205  5655G53  5655G53  34.01  2009/145  PQRS000156             
ABCD0210  5655G53  5655G53  34.01  2009/145  PQRS000146             
ABCD0260  5655G53  5655G53  34.01  2009/132  PQRS000169               
----+----1----+----2----+----3----+----4----+----5----+----6

thanks in advance for all.....
:-)
Back to top
View user's profile Send private message

genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Jun 10, 2009 10:58 pm    Post subject:
Reply with quote

one way of doing can be..

Code:

//S1 EXEC PGM=SYNCTOOL                                   
//TOOLMSG DD SYSOUT=*                                   
//DFSMSG DD SYSOUT=*                                     
//IN DD *                                               
ABCD0205  5655G53  5655G53  34.01  2009/145             
ABCD0205                                     PQRS000156 
ABCD0210  5655G53  5655G53  34.01  2009/145             
ABCD0210                                     PQRS000046 
ABCD0260  5655G53  5655G53  34.01  2009/132             
ABCD0260                                     PQRS000169 
//OUT DD SYSOUT=*                                       
//TOOLIN  DD *                                           
  SPLICE FROM(IN) TO(OUT) ON(1,8,CH) WITH(46,60)         
/*                                                       
Back to top
View user's profile Send private message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Thu Jun 11, 2009 9:45 am    Post subject: Reply to: Merging two records with the same key
Reply with quote

Thanx genesis786....

It really works fine for me....

:-)
Back to top
View user's profile Send private message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Thu Jun 11, 2009 10:54 pm    Post subject:
Reply with quote

hi...genesis786....Could you help me...?
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201  5655G53  5655G53  34.01  2009/140           
ABCD0205  5655G53  5655G53  34.01  2009/141               
ABCD0205                                     PQRS000156 
ABCD0210  5655G53  5655G53  34.01  2009/149                 
ABCD0210                                     PQRS000046 
ABCD0220  5655G53  5655G53  34.01  2009/145             
ABCD0260                                     PQRS000169 
ABCD0260  5655G53  5655G53  34.01  2009/132               
ABCD0290  5655G53  5655G53  34.01  2009/195             
ABCD0360  5655G53  5655G53  34.01  2009/175             
----+----1----+----2----+----3----+----4----+----5----+----6

output i am receiving o/p with ur job is...
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201 
ABCD0205  5655G53  5655G53  34.01  2009/141  PQRS000156             
ABCD0210  5655G53  5655G53  34.01  2009/149  PQRS000046               
ABCD0220 
ABCD0260  5655G53  5655G53  34.01  2009/132  PQRS000169             
ABCD0290 
ABCD0360 
----+----1----+----2----+----3----+----4----+----5----+----6

but i need out put like this.....
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201  5655G53  5655G53  34.01  2009/140           
ABCD0205  5655G53  5655G53  34.01  2009/141  PQRS000156             
ABCD0210  5655G53  5655G53  34.01  2009/149  PQRS000046               
ABCD0220  5655G53  5655G53  34.01  2009/145             
ABCD0260  5655G53  5655G53  34.01  2009/132  PQRS000169             
ABCD0290  5655G53  5655G53  34.01  2009/195             
ABCD0360  5655G53  5655G53  34.01  2009/175             
----+----1----+----2----+----3----+----4----+----5----+----6


I am receiving exact output only if my records have its pair record...
otherwise i am receiving only the key....

pls help me to find the soln...

thanks in advance for all...

:-)
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Thu Jun 11, 2009 11:25 pm    Post subject:
Reply with quote

i am sure this is not a very elegant way of doing it, but it's one way if you are just interested in getting right output. icon_smile.gif

Code:

//S1 EXEC PGM=SYNCTOOL                                   
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG DD SYSOUT=*                                     
//IN DD *                                                 
ABCD0201  5655G53  5655G53  34.01  2009/140               
ABCD0205  5655G53  5655G53  34.01  2009/141               
ABCD0205                                     PQRS000156   
ABCD0210  5655G53  5655G53  34.01  2009/149               
ABCD0210                                     PQRS000046   
ABCD0220  5655G53  5655G53  34.01  2009/145               
ABCD0260                                     PQRS000169   
ABCD0260  5655G53  5655G53  34.01  2009/132               
ABCD0290  5655G53  5655G53  34.01  2009/195               
ABCD0360  5655G53  5655G53  34.01  2009/175               
/*                                                             
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS) 
//OUT DD SYSOUT=*                                             
//TOOLIN  DD *                                                 
  SORT FROM(IN) TO(T1) USING(CTL1)                             
  SPLICE FROM(T1) TO(OUT) ON(1,8,CH) KEEPNODUPS WITH(46,20)   
/*                                                             
//CTL1CNTL DD *                                               
  SORT FIELDS=(1,8,CH,A,11,1,CH,D)                             
/*                                                             
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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