View previous topic :: View next topic
|
Author |
Message |
vaibhavkolhe
New User
Joined: 24 Feb 2005 Posts: 11
|
|
|
|
Hi,
I want to know if there is any option which can be given in DF Sort utility which will merge two files in a particular manner.
Let me explain what I exactly wish to do. I have two files say File A
& File B both of the same length, and I am using DFsort to merge the
two files. Now there is a field A on file A which has all same
values....say 'a'. This file has about 40 million records. Similarly
on File B there is a field B which has all same values .....say 'b'.
Now I want to merge the two files and create a 3rd file say File C
which has the same structure as both 'A' & 'B'. Hence in File 'C' the
Fields A & B will be at the same disposition as the earlier 2 files.
Now on File C this field must have value 'a' all over(ie the value
from File A). Although we can use OUTREC, I have worked with only
hardcoding the values in OUTREC parameter, but what makes this problem
difficult is the the value of 'a' is going to change every month.
Hence it can't be hardcoded. So the solution that will be provided
will need to be as generic as possible.
I will be glad if anyone can help ASAP.
Thanks,
Vaibhav |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your explanation of what you want to do is not at all clear. When you say "merge", do you mean the MERGE function where the records of each file are already in sorted order and you want the output file to be in the same sorted order. Or do you mean something else, like wanting to join fields from record 1 of file A with record1 of file B, record2 of file A with record2 or file B, etc? (You could use the SPLICE operator of DFSORT's ICETOOL for join and match operations.) Or do you mean something else?
Please show an example of the records in File A and the records in File B and what you want the output records to look like. What is the RECFM and LRECL of File A and File B? What is the starting position, length and format of each relevent field in File A and File B.
Quote: |
Hence in File 'C' the Fields A & B will be at the same disposition as the earlier 2 files. |
What do you mean by disposition? Do you mean position? Or something else?
Quote: |
Now on File C this field must have value 'a' all over(ie the value
from File A). |
What do you mean by "all over"?
I'd be happy to help you create the DFSORT or ICETOOL job you need, but I can't do that until you explain clearly what it is you want to do and provide an exampe of input and output. |
|
Back to top |
|
|
vaibhavkolhe
New User
Joined: 24 Feb 2005 Posts: 11
|
|
|
|
Hi Frank,
I understand your questions. However, I got the problem resolved. The field 'A' in File A & field 'B' in file B were the dates at the end of the month and since dates keep changing each month, the solution was required to be generic.
However, File A is created from the BMC Unload utility and field 'A' is populated from the table. I used the LAST_DAY function of DB2(LAST_DAY(Current date - 1 month) to get this date as the last day of the processing month & further merged it with field 'B' in file B which always had the last day of the processing month. This way it worked perfectly.
However, thanks for your help & questions.
Vaibhav |
|
Back to top |
|
|
|