COMPARE and MERGE particular columns in DFSORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

COMPARE and MERGE particular columns in DFSORT

Postby vkumarg3 » Mon Feb 22, 2016 9:21 pm

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.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: COMPARE and MERGE particular columns in DFSORT

Postby BillyBoyo » Mon Feb 22, 2016 9:47 pm

Yes, it is a simple JOINKEYS. Lots of examples in here, also in the manuals.

These users thanked the author BillyBoyo for the post:
vkumarg3 (Tue Feb 23, 2016 12:40 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: COMPARE and MERGE particular columns in DFSORT

Postby vkumarg3 » Tue Feb 23, 2016 12:41 pm

Hi BillyBoyo,
Thanks for your quick response.
Please help to provide some example. I am unable to see example for such scenario.

Thanks.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: COMPARE and MERGE particular columns in DFSORT

Postby NicC » Tue Feb 23, 2016 4:11 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: COMPARE and MERGE particular columns in DFSORT

Postby BillyBoyo » Tue Feb 23, 2016 8:51 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post