Many to Many Record Splicing using Icetool



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Many to Many Record Splicing using Icetool

Postby Eswarbabu » Tue Dec 27, 2011 2:26 pm

Hi,

We can employ splice command to successfully perfom one-to-many record splicing.

My requirement is, i have two records (represented here as 'A') which are to be spliced with 'n' records (represented here as 'B' )based on 'dayname' as matching condition.

(say)

A:

20111227..........SUN
20111228..........MON

B:

........YYYYYYYYYYSUN
........XXXXXXXXXXSUN
........2222222222MON
........3333333333MON

My end result should look like...

20111227YYYYYYYYYYSUN
20111228XXXXXXXXXXSUN
201112282222222222MON
201112283333333333MON
Eswarbabu
 
Posts: 9
Joined: Tue Dec 27, 2011 12:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Many to Many Record Splicing using Icetool

Postby Eswarbabu » Tue Dec 27, 2011 4:12 pm

Sorry, please find the proper example

(say)

A:

20111225..........SUN
20120101..........SUN

20111226..........MON
20120102..........MON


B:

........YYYYYYYYYYSUN
........XXXXXXXXXXSUN
........2222222222MON
........3333333333MON

My end result should look like...

20111225YYYYYYYYYYSUN
20111225XXXXXXXXXXSUN

20120101YYYYYYYYYYSUN
20120101XXXXXXXXXXSUN

201112262222222222MON
201112263333333333MON

201201022222222222MON
201201023333333333MON
Eswarbabu
 
Posts: 9
Joined: Tue Dec 27, 2011 12:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Many to Many Record Splicing using Icetool

Postby skolusu » Tue Dec 27, 2011 11:20 pm

Use the following DFSORT JCL which will give you the desired results. I assumed that your output lrecl is 80

//STEP0100 EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//INA      DD *                         
----+----1----+----2----+----3----+----4
20111225..........SUN                   
20120101..........SUN                   
20111226..........MON                   
20120102..........MON                   
//INB      DD *                         
........YYYYYYYYYYSUN                   
........XXXXXXXXXXSUN                   
........2222222222MON                   
........3333333333MON                   
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                         
  JOINKEYS F1=INA,FIELDS=(19,3,A)       
  JOINKEYS F2=INB,FIELDS=(19,3,A)       
  REFORMAT FIELDS=(F1:1,8,F2:9,10,19,62)
  OPTION COPY                           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post