Posted: Wed Apr 25, 2007 8:25 am Post subject: How to get matched records from three input files.
I have first input file(policy file) as
Code:
POLICY NUMBER |DATE1 |DATE2 |POLKEY
----+----1----+----2----+----3----+----4----+----5----+
***************************** Top of Data ***********
TRA010005001 17.01.200716.01.2007dasd123
TRA010005002 20.02.200719.02.2008da12413
TRA010005003 21.02.200720.02.2008gfsdg43
TRA010005005 16.01.200715.01.2007sdfsdf5
TRA010005008 21.02.200720.02.2008sdfsdf4
**************************** Bottom of Data *********
file length is 55 with Pol num:25, DATE1: 10, DATE2:10,
Polkey:10
second input file(cover file) is
Code:
POLICY NUMBER |DATE1 |DATE2 |COVKEY
----+----1----+----2----+----3----+----4----+----5----+
***************************** Top of Data *************
TRA010005001 17.01.200716.01.2007dasd123
TRA010005002 20.02.200719.02.2008da12413
TRA010005004 15.01.200715.01.2007sdfsdf6
TRA010005006 21.02.200720.02.2008sdfsdf4
TRA010005008 21.02.200720.02.2008sdfsdf4
**************************** Bottom of Data *********
file length is 55 with Pol num:25, DATE1: 10, DATE2:10,
Cltkey:10
third input file(client file) is
Code:
POLICY NUMBER |DATE1 |DATE2 |CLTKEY
----+----1----+----2----+----3----+----4----+----5----+
***************************** Top of Data *************
TRA010005001 17.01.200716.01.2007dasd123
TRA010005003 21.02.200720.02.2008gfsdg43
TRA010005004 15.01.200715.01.2007sdfsdf6
TRA010005007 21.02.200720.02.2008sdfsdf4
TRA010005008 21.02.200720.02.2008sdfsdf4
**************************** Bottom of Data ***********
file length is 55 with Pol num:25, DATE1: 10, DATE2:10,
Covkey:10
I want to have my first output file as following which has matching policy number, date1 and date2 in all three files.
OUTPUTFILE1:
Code:
POLICY NUMBER |DATE1 |DATE2 |POLKEY |COVKEY |CLTKEY
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
***************************** Top of Data *********************************
TRA010005001 17.01.200716.01.2007dasd123 dasd123 dasd123
TRA010005008 21.02.200720.02.2008sdfsdf4 sdfsdf4 sdfsdf4
**************************** Bottom of Data *******************************
Second output file should contain records of Policy file which doesn _________________ Thanks
Madhu Sudhan
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Thu Apr 26, 2007 6:15 am Post subject:
psmadhusudhan
Quote:
I want to have the above submitted process done in Icetool using Splice, not easytrieve
I think that kolusu was trying to be helpful with the response given, and nowhere in your original post did you specify that this had to be achieved using SORT.
Perhaps it is my interpretation of your reply, but please show a little more gratitude to those that try to help you.
Maybe you will get the result you want from the other forum where you have posted this. But at least you did include your response to kolusu on the other forum, so hopefully no one will upset you again by trying to suggest an alternative solution. _________________ If it's true that we are here to help others,
then what exactly are the others here for ?
I am sorry that I forgot to ask in my question whether I want the solution using sort or not.
Regarding my reply to Kolosu, I was just straight, I think u had taken t in otherway. I am very happy that somebody is trying to help me. And I am very gratefull to allthose who will help me.
I didnt post this query in anyother topic. If possible can u try to give me
a solution. _________________ Thanks
Madhu Sudhan
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Thu Apr 26, 2007 8:37 am Post subject:
From the output that you have posted, you have DFSORT installed which means that you can use ICETOOL.
I will try to give you some help, but I'm sure that Frank will come up with about half the amount of code that I've used.
First you need to reformat your records so that you can splice them, using the output above I see they are FB 80 records.
a) IN1 we will leave as is, as it has the blanks after the POLKEY
b) IN2 needs blanks to replace the 7 bytes at POS 46 and put the 7 bytes at POS 53
c) IN3 needs to put 14 blanks at POS 46 and the 7 bytes from POS 46 at POS 60
That should, hopefully give you your first output file. _________________ If it's true that we are here to help others,
then what exactly are the others here for ?
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Apr 26, 2007 9:05 pm Post subject:
Madhu,
If I understand correctly what you want, then the output you show is consistent with what you said. Keys 2 and 3 of input file1 do not appear in all three files, so you want them in output file 2.
I believe this DFSORT/ICETOOL job will do what you asked for based on the example you showed. If there are other variations you didn't show, then the job may have to be tweaked a bit to cover those.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum