View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi, All
I am having a problem in merging my datasets to extract the complete information.
Input 1
U1 P1 N1
U1 P2 N2
Input 2
U1 P1 A1
U1 P2 A2
Input 3
U1 P1 S1
U2 P2 S2
U2 P3 S3
Output dataset
U1 P1 N1 A1 S1
U2 P2 N2 A2 S2
All the 3 input have LRECL=80
The Key to be used is U1 & P1
U1 is of 2 character & P1 is of 10 character
N1 & A1 are 50 character long & S1 is 2 character long.
Can I merge this in a single Easytrieve.
Thanks
Rahul Gupta |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Yes, In the "JOB INPUT" specify all 3 files and both keys for each.
Remember to consider: Could any of the files have duplicate keys or missing keys and if so what result should it give. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Douglas
Thanks for your response.
I am having another problem here that I don't know how to do this
"Remember to consider: Could any of the files have duplicate keys or missing keys and if so what result should it give." |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
First the answers to the questions need to be obtained:
Can File 1 have duplicate keys?
Can File 2 have duplicate keys?
Can File 3 have duplicate keys?
Can File 1 have missing keys (that are in File 2 and/or File 3)?
Can File 2 have missing keys (that are in File 1 and/or File 3)?
Can File 3 have missing keys (that are in File 1 and/or File 2)?
If there may be duplicates on 1 file put that file first.
If any of the Files may have missing keys, use "IF file-name" before using any field from that file so that you do not reference non-existent fields.
Try it and let us know you get stuck on anything. |
|
Back to top |
|
|
|