IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merging two records with the same key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top