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

Merging 2 files conditionally


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Fri Jun 26, 2009 4:58 pm
Reply with quote

Hello,
I want to merge 2 dataset just like described at the sample,
is it possible?
Thanks...


dataset 1 (FB, LRECL = 16)
Code:
000001 testdata1
000002 testdata2
000003 testdata3
000004 testdata4
000005 testdata5
000006 testdata6


dataset2 (FB, LRECL=12)
Code:
000001 info1
000003 info3
000004 info4


desired Output dataset (FB LRECL=21)
Code:
000001 testdata1info1
000002 testdata2     
000003 testdata3info3
000004 testdata4info4
000005 testdata5     
000006 testdata6     
Back to top
View user's profile Send private message
ozgurseyrek

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Fri Jun 26, 2009 6:23 pm
Reply with quote

I have merged files with that jcl,
thanks..
Code:
                                                                 
//SORTST1  EXEC  PGM=ICETOOL                                       
//TOOLMSG  DD    SYSOUT=*                                         
//DFSMSG   DD    SYSOUT=*                                         
//IN1      DD    DSN=DATASET1,DISP=SHR                     
//IN2      DD    DSN=DATASET2,DISP=SHR                     
//TMP1     DD    DSN=DATASET.TEMP,DISP=MOD                 
//OUT      DD    DSN=DATASET.OUT,DISP=(NEW,CATLG,KEEP),   
//             RECFM=FB,LRECL=21,SPACE=(CYL,(1,1),RLSE)           
//TOOLIN   DD    *                                                 
 COPY FROM(IN1) TO(TMP1) USING(CPY1)                               
 COPY FROM(IN2) TO(TMP1) USING(CPY2)                               
 SPLICE FROM(TMP1) TO(OUT) ON(1,6,CH) WITHALL KEEPNODUPS WITH(17,5)
/*                                                                 
//CPY1CNTL DD    *                                                 
 OUTREC FIELDS=(1:1,16,17:5X)                                     
/*                                                                 
//CPY2CNTL DD    *                                                 
 OUTREC FIELDS=(1:1,6,8:09X,17:8,5)                               
/*                                                                 
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top