Data required from both files depending on some keys



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

Data required from both files depending on some keys

Postby Papya013 » Tue May 10, 2016 6:47 pm

Hi Team,

I have two sorted files FILE1 and FILE2 which has common field xxxx, I am looking for data in output file from FILE2 if the key matches and data from FILE1 if key does not matches.

could you please suggest SORT card using JOINKEYS.

Regards,
Balesh GG
Papya013
 
Posts: 35
Joined: Wed Nov 06, 2013 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data required from both files depending on some keys

Postby BillyBoyo » Tue May 10, 2016 9:29 pm

Yes, it is JOINKEYS you want. You have a very simple situation, which is easily covered in the manuals. Have a look at the DFSORT Getting Started manual. The JOINKEYS statement is very simple, and since your data is already ordered, you want to specify SORTED,NOSEQCK. If you don't specify SORTED, it will be SORTed again, by default, which you never want.

You'll need a JOIN statement, to allow matches, and the mismatched file you want. A REFORMAT statement to give you the data, and the match-marker in the REFORMAT so you easily know what type of REFORMAT record you have.
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