Filtering Input Records in Sequential file
Posted: Wed Jul 20, 2005 5:54 pm
Hi Guys,
My Input file is of the below format
Each Value in ColA has mutliple different values for ColB
My Lookup file is of the below format
The requirement for my job is that I need to match the input file records based on the value of ColA. Then I need to take the corresponding value of ColC and go to the input file and grab that many number of rows of ColB(from the last, assuming that my input file is sorted based on ColA,ColB).
What is the best/efficient way to do this task?
Any Inputs will be greatly appreciated.
My Input file is of the below format
Code: Select all
ColA ColB
10 100
10 101
10 102
10 103
22 910
22 911
22 912
My Lookup file is of the below format
Code: Select all
ColA ColC
10 2
22 1
Code: Select all
For Example
For ColA value of 10, the value of ColC is 2
Now I need to go to the input file and among the rows with ColA value of 10, grab the last 2 rows and send them to output link and send the other rows to the reject link.
Any Inputs will be greatly appreciated.