Page 1 of 1

COMPARE and MERGE particular columns in DFSORT

PostPosted: Mon Feb 22, 2016 9:21 pm
by vkumarg3
Hi,

Can anyone please help me out to merge two datasets horizontally using DFSORT as shown below.

For Example,

Data-1:
ID   Name
001 Ashok
002 Bharath
002 Sami
003 Anand

ID: 1 to 3
Name : 5 to 15

Data-2:
DOB       ID
07MAR1984 001
02JAN1982 002
04APR1981 002
17NOV1985 003

DOB : 1 to 9
ID : 11 to 13

The output is,
Data-3:
ID  Name      DOB
001 Ashok     07MAR1984
002 Bharath   02JAN1982
002 Sami      04APR1981
003 Anand     17NOV1985

ID: 1 to 3
Name : 5 to 15
DOB : 17 to 25
 


Is there a DFSORT to achieve this output.
Note:-
1) File1, File2 will not contain any duplicates.
2) File1 is FB, LRECL = 15, Key = 1 - 3
3) File2 is FB, LRECL = 13, Key = 11 - 13

Thanks in Advance..

Regards,
Vignesh.

Re: COMPARE and MERGE particular columns in DFSORT

PostPosted: Mon Feb 22, 2016 9:47 pm
by BillyBoyo
Yes, it is a simple JOINKEYS. Lots of examples in here, also in the manuals.

Re: COMPARE and MERGE particular columns in DFSORT

PostPosted: Tue Feb 23, 2016 12:41 pm
by vkumarg3
Hi BillyBoyo,
Thanks for your quick response.
Please help to provide some example. I am unable to see example for such scenario.

Thanks.

Re: COMPARE and MERGE particular columns in DFSORT

PostPosted: Tue Feb 23, 2016 4:11 pm
by NicC
Your task is to find an example that sort of looks like what you want and then adapt it to your specific scenario using a combination of the examples and the manual and plain try-it-and-see.

Re: COMPARE and MERGE particular columns in DFSORT

PostPosted: Tue Feb 23, 2016 8:51 pm
by BillyBoyo
You should find the DFSORT: Getting Started publication for your version of DFSORT. There is a whole chapter, Chapter 8, on Joining records, with examples.

You'll also find examples here.