How to use DFSORT/ICETOOL in this scenario



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

How to use DFSORT/ICETOOL in this scenario

Postby nandanphalak » Mon Nov 29, 2010 11:03 pm

Hi,

I have two files, both are fixed block.
File1 : File length 8
T1T2S1G1
T1T3S1G1
T2T3S1G1
T1T2S2G1
T1T3S2G1

File2: File length 8
I1T1T2W1
I2T1T2W2
I3T1T3W3
I4T2T3W4
I5T1T2W5
I6T1T3W6
I7T1T3W7
I8T1T3W8

Now, I need to match first 4 bytes of File1 with 3rd to 6th bytes of File2 (middle 4 bytes).
The O/p file should have number of records in File1 multiplied by number of records in File 2, if the match happens.

The o/p file would look like this:

T1T2S1G1I1W1
T1T2S1G1I2W2
T1T2S1G1I5W5
T1T3S1G1I3W3
T1T3S1G1I6W6
T2T3S1G1I4W4
T1T2S2G1I1W1
T1T2S2G1I2W2
T1T2S2G1I5W5

How to do this using DFSORT/ICETOOL/SPLICE? Anything which works with high performance is fine to me.

Best Regards
nandanphalak
 
Posts: 2
Joined: Mon Nov 29, 2010 10:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to use DFSORT/ICETOOL in this scenario

Postby Frank Yaeger » Tue Nov 30, 2010 12:31 am

It seems like your output is missing some records. Based on your "rules", wouldn't the output be:

T1T2S1G1I1W1
T1T2S1G1I2W2
T1T2S1G1I5W5
T1T2S2G1I1W1
T1T2S2G1I2W2
T1T2S2G1I5W5
T1T3S1G1I3W3
T1T3S1G1I6W6
T1T3S1G1I7W7
T1T3S1G1I8W8
T1T3S2G1I3W3
T1T3S2G1I6W6
T1T3S2G1I7W7
T1T3S2G1I8W8
T2T3S1G1I4W4


If so, then you can use this DFSORT job:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/8)
//SORTOUT DD DSN=...  output file (FB/12)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(1,4,A)
  JOINKEYS F2=IN2,FIELDS=(3,4,A)
  REFORMAT FIELDS=(F1:1,8,F2:1,2,7,2)
  OPTION COPY
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: How to use DFSORT/ICETOOL in this scenario

Postby nandanphalak » Tue Nov 30, 2010 2:29 am

Yes Frank.. You are right.. and this job is perfect.. Thanks for your time and help!!

Best Regards
nandanphalak
 
Posts: 2
Joined: Mon Nov 29, 2010 10:43 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post