1 Kiran
2 address
3 salary details
4 extra information
1 Rahul
2 address
3 salary details
1 Hima
2 address
3 salary details
4 extra information
I need to compare these two files based on File1 : record type 1 which is in 1st position and Name which is in 4th position with File2 : record type 1 whcih is in 1st position and Name which is in 4th position and copy FILE1 NUM which at position 146 of 5 bytes and Phone which is at 153 of 11 bytes to new file along with file2 data.
My output should looke like
Code:
NUM :12345 PHONE:04012345678
1 Kiran
2 address
3 salary details
4 extra information
NUM :12346 PHONE:04012345679
1 Rahul
2 address
3 salary details
NUM :12346 PHONE:04012345670
1 Hima
2 address
3 salary details
4 extra information
However, this may still be possible without joinkeys. Please answer or clarify below assumptions.
I see that for each new phone number in file 1, seq number resets to 1. Is that always true? Are you always going to have 1 to 1 match between 2 file meaning 1st record of first phone number group goes with first record of file2's first group?
P.S. The solution posted above works for dfsort and is tested.
File1 have records with record tyeps 1,2,3,4,...etc as well file2 have records with record type 1,2,3,4,5,...etc
we need to copare file1 record type and name associated that record type with file recodd type and name associated with it. record type 1 is always represents name record.
if file1 record type1 name and file2 recordtype1 name matches we need to copy file2 data to output file along with some values from file1 as i mentioned in my first post
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I have both the products in my shop, DFSORT solution also helps me in solving my problem as i can use DFSORT also.
Hima1985,
sqlcode1 gave you a solution that works with DFSORT providing you have the JOINKEYS PTF which has been available since November, 2009. You came back saying that it didn't work with Syncsort which makes sense since DFSORT supports JOINKEYS options that Syncsort doesn't support.
Then you came back saying you have both products but you didn't say if you tried sqlcode1's solution with DFSORT. Did you? If so, what were the results? If it didn't work, show the complete JES log for the DFSORT run including all of the ICExxxs messages.
Dick Brenholtz,
Thanks for the translation good one , other people in group might have made you to think like that with their posts before, but its not the case with me. Jfyi: I can post this in syncsort link if I want syncsort solution lol
Hima1985,
See if below works. Below is the content of TEST.FB250DM which is 250 bytes/FB file.
Code:
$$$
I don't have syncsort documentation and hence I don't really know if the solution mentioned is supported or not with your Syncsort function level but I really "hope" it should work for your requirement.