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

Joining of multiple files horizontally


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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri May 11, 2007 9:44 pm
Reply with quote

Hi

My requirement is some what similar to the one in Sort trick pdf, In which it attempts to join 2 files horizontally.
In my case i need to Join 12 files side by side.

Initially i tried same with 3 files
CODE is as follows:

Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
001 AAAAA                                                               
002 CCCCC                                                               
003 EEEEE                                                               
004 GGGGG                                                               
/*                                                                     
//IN2      DD *                                                         
003 DDDDD                                                               
004 FFFFF                                                               
005 HHHHH                                                               
/*                                                                     
//IN3      DD *                                                         
003 BBBBB                                                               
003 DDDDD                                                               
003 HHHHH                                                               
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA 
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1) TO(TMP1) USING(CPY1)                                   
 COPY FROM(IN2) TO(TMP1) USING(CPY2)                                   
 COPY FROM(IN3) TO(TMP1) USING(CPY3)                                   
 SPLICE FROM(TMP1) TO(OUT) ON(36,8,PD)  -                               
  WITHEACH   WITH(10,9) WITH(19,9) USING(CPY4)                         
/*                                                                     
//CPY1CNTL DD  *                                                       
  OUTREC FIELDS=(1:1,9,36:SEQNUM,8,PD)                                 
/*                                                                     
//CPY2CNTL DD  *                                                       
  OUTREC FIELDS=(10:1,9,36:SEQNUM,8,PD)                                 
/*                                                                     
//CPY3CNTL DD  *                                                       
  OUTREC FIELDS=(19:1,9,36:SEQNUM,8,PD)                                 
/*                                                                     
//CPY4CNTL DD  *                                                       
  OUTFIL FNAMES=OUT,OUTREC=(1,35)                                       
/*                                                                     


The O/P is
Code:
001 AAAAA003 DDDDD003 BBBBB
002 CCCCC004 FFFFF003 DDDDD
003 EEEEE005 HHHHH003 HHHHH


And the expected o/p is
Code:
001 AAAAA003 DDDDD003 BBBBB
002 CCCCC004 FFFFF003 DDDDD
003 EEEEE005 HHHHH003 HHHHH
004 GGGGG                 

Meant to say that, the code is not working as expected wn i/p contains different number of records.
How do i get this ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 11, 2007 11:00 pm
Reply with quote

For the example you show, adding KEEPNODUPS to the SPLICE operator will give you what you asked for, e.g.

Code:

SPLICE FROM(TMP1) TO(OUT) ON(36,8,PD)  KEEPNODUPS -                   
  WITHEACH   WITH(10,9) WITH(19,9) USING(CPY4)   
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat May 12, 2007 3:37 pm
Reply with quote

thanks frank, ur suggestion is working icon_cool.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top