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

SYNCSORT combine two records into one record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
weibiao

New User


Joined: 08 Jun 2008
Posts: 5
Location: China

PostPosted: Tue Sep 16, 2008 6:41 pm
Reply with quote

I want to combine two records in two files to one record in the third file, could any one tell me how?

For example,
file A:

AAABBB
CCCDDD
EEEFFF

file B:
XXXYYY
YYYZZZ
ZZZXXX

I want to combine the two files to file c:
AAABBBXXXYYY
CCCDDDYYYZZZ
EEEFFFZZZXXX
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Tue Sep 16, 2008 7:17 pm
Reply with quote

Hi I think this has been already discussed in Forum .
Any ways FYI .. Please find the below JCL to satisfy your requirement .
Code:

//STEPS200 EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN1      DD *                                                   
AAABBB                                                             
CCCDDD                                                             
EEEFFF                                                             
/*                                                                 
//IN2      DD *                                                   
XXXYYY                                                             
YYYZZZ                                                             
ZZZXXX                                                             
/*                                                                 
//T1 DD DSN=&&ATTU3,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),             
// UNIT=SYSDA                                                     
//TOOLIN   DD *                                                   
  COPY FROM(IN1) TO(T1) USING(CTL1)                               
  COPY FROM(IN2) TO(T1) USING(CTL2)                               
  SPLICE FROM(T1) TO(OUT) ON(31,6,CH) WITH(8,6) USING(CTL3)       
/*                                                                 
//CTL1CNTL DD *                                                   
  OUTREC FIELDS=(1:1,30,31:SEQNUM,6,ZD)                           
/*                                                                 
//CTL2CNTL DD *                                                   
  OUTREC FIELDS=(8:1,6,31:SEQNUM,6,ZD)                             
/*                                                                 
//CTL3CNTL DD *                                                   
  OUTFIL FNAMES=OUT,BUILD=(1,30)                                   
/*                                                                 
//OUT      DD SYSOUT=*


O/P :
AAABBB XXXYYY
CCCDDD YYYZZZ
EEEFFF ZZZXXX

Hope this helps .
Back to top
View user's profile Send private message
weibiao

New User


Joined: 08 Jun 2008
Posts: 5
Location: China

PostPosted: Tue Sep 16, 2008 9:37 pm
Reply with quote

Thanks Mulla.
The answer is very good.
Back to top
View user's profile Send private message
banand

New User


Joined: 05 Jun 2007
Posts: 28
Location: Mumbai

PostPosted: Wed Sep 17, 2008 12:06 pm
Reply with quote

Gousiya Mulla wrote:
Hi I think this has been already discussed in Forum .
Any ways FYI .. Please find the below JCL to satisfy your requirement .
Code:

//STEPS200 EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN1      DD *                                                   
AAABBB                                                             
CCCDDD                                                             
EEEFFF                                                             
/*                                                                 
//IN2      DD *                                                   
XXXYYY                                                             
YYYZZZ                                                             
ZZZXXX                                                             
/*                                                                 
//T1 DD DSN=&&ATTU3,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),             
// UNIT=SYSDA                                                     
//TOOLIN   DD *                                                   
  COPY FROM(IN1) TO(T1) USING(CTL1)                               
  COPY FROM(IN2) TO(T1) USING(CTL2)                               
  SPLICE FROM(T1) TO(OUT) ON(31,6,CH) WITH(8,6) USING(CTL3)       
/*                                                                 
//CTL1CNTL DD *                                                   
  OUTREC FIELDS=(1:1,30,31:SEQNUM,6,ZD)                           
/*                                                                 
//CTL2CNTL DD *                                                   
  OUTREC FIELDS=(8:1,6,31:SEQNUM,6,ZD)                             
/*                                                                 
//CTL3CNTL DD *                                                   
  OUTFIL FNAMES=OUT,BUILD=(1,30)                                   
/*                                                                 
//OUT      DD SYSOUT=*


O/P :
AAABBB XXXYYY
CCCDDD YYYZZZ
EEEFFF ZZZXXX

Hope this helps .


Hi
Can you please explain how this code works?

Thanks In advance

Thanks,
Brit
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Sep 17, 2008 12:23 pm
Reply with quote

Banand,

Quote:
Can you please explain how this code works?


Take a look at the manual DFSORT getting started

Read and understand the topic on SPLICE and then post if you still don't understand the JCL.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top