View previous topic :: View next topic
|
Author |
Message |
manikanth_e
New User
Joined: 27 Mar 2007 Posts: 13 Location: chennai
|
|
|
|
hello,
I have two sequential files for matching. The following is the requirement by using DFSORT:
Code: |
File A File B
FieldA FieldA FieldB
A A 1
B A 2
C B 3
B 4
C 5
|
When i match the above two files based on the field A. I need the Sequential file C in the below format.
Code: |
File C
A 1 2
B 3 4
C 5
|
Can anyone please help me out?
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You need to give more information about what you want to do.
What is the RECFM and LRECL of fileA and fileB?
What is the starting position, length and format of fieldA in fileA and fields A and B in fileB?
Is field A unique in fileA (only one A, one B, etc). Are there only two records maximum with each field A value (e.g. A or A, A but not A, A, A)?
What do you want to do with fieldA values in fileA that have no match in fileB? What do you want to do with fieldA values in fileB that have no match in fileA?
A better example showing the actual fields in each file and all of the different variations would help. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please start over. Your file "defiinitions" are not at all clear. Some may understand what you've said, but many will not.
Post the info as "Code" using the tab at the top of the reply panel and make sure that the files are separated. This will make your post more readable.
This
Quote: |
File A File B
FieldA FieldA FieldB
A A 1
B A 2
C B 3
B 4
C 5
|
provides no consistancy. How many fields are really in each file (1, or 2 or ?)? |
|
Back to top |
|
|
manikanth_e
New User
Joined: 27 Mar 2007 Posts: 13 Location: chennai
|
|
|
|
Frank,
The below is the info you need:
RECFM and LRECL of FILE A and FILE B are same.
FieldA in FileA starts at position1 and ends at position9.
FieldA in FileB starts at position1 and ends at position9.
FieldB in FileB starts at position11 and ends at position20.
and,
FieldA in FileA is not unique (multiple As and multipe Bs can occur). There is nothing like two records maximum with each fieldA value. It may vary.
The below is the example:
Code: |
FileA FileB
FieldA FieldA FieldB
A A 1
A A 2
B A 3
B B 4
B
C
|
FileA (lrecl - 50) can consists multiple rows with same value for fieldA.
FileB (lrecl - 50) can consists multiple rows with same value foe fieldA.
When FileA is matched on FileB based on the FieldA for retrieving FieldB of FileB. The below should be the output.
Code: |
A 1 2 3
A 1 2 3
B 4
B 4
B 4
C
|
As C doesnt have the match on file B, no corresponding values are seen.
please let me know in case you need furthur details.
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I don't know of any way to do this with DFSORT/ICETOOL. |
|
Back to top |
|
|
|