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
 
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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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