Synscort_Search for key in multiple columns of input file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Synscort_Search for key in multiple columns of input file

Postby r rudram » Tue Dec 27, 2011 3:57 pm

(Initially posted to the DFSort forum in error, then moved it out here as we use Syncsort - )

Hello,

I have an input file as follows (File A) and another VSAM lookup file (File B)

The rules -

The keys from B will need to be looked up in input A in multiple columns. If there is a match of the keys in any of the columns of input , it will be written to a
matched file, and the unmatched records from A will be written to another file. In the example below, the columns in file A to be searched are 1:11, 19:29, 31:41, 43:53 , and 55:65.

File B (key file) - (cols 1:11)
00179009330 68865474940494
00179102650 30062775537799
00656566453 64996600884844
00656566454 64996600884844



Input file A
00179009330 Smith 00453405343 00179009330 00984323443               
00179102650 John  00179102650 00356877555                           
00587656755 Doe   00179195730 00656566454                           
00485758655 Alice 00643343333 00000000222 00444443333 00775857575   
00179009330 Jane  00656566453 00000000222                           


Output file (unmatched)
00485758655 Alice 00643343333 00000000222 00444443333 00775857575 


Output file (matched)
00179009330 Smith 00453405343 00179009330 00984323443             
00179102650 John  00179102650 00356877555                         
00587656755 Doe   00179195730 00656566454                         
00179009330 Jane  00656566453 00000000222                         


Is there any elegant way I could use splice/joinkeys for the multiple fields without having to go through several passes with joinkeys?
Thank you!
r rudram
 
Posts: 4
Joined: Wed Dec 21, 2011 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Synscort_Search for key in multiple columns of input fil

Postby BillyBoyo » Tue Dec 27, 2011 4:28 pm

I don't have SyncSort documentation. Does SyncSort have something equivalent to the Slash (/) operator that DFSORT has for OUTFIL (OUTREC and BUILD)?

If so, you can process your VSAM file, creating the keys. Sort them dropping the duplicates.

Then the JOIN becomes simple.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Synscort_Search for key in multiple columns of input fil

Postby r rudram » Wed Dec 28, 2011 12:07 am

Hi BillyBoyo,

Thank you.. I forgot to mention that the VSAM file B has already beens sorted and contains unique keys.
Beyond this point is where I am stumped - would the only option be multiple Join steps for the columns in A ?

Thank you!
r rudram
 
Posts: 4
Joined: Wed Dec 21, 2011 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Synscort_Search for key in multiple columns of input fil

Postby BillyBoyo » Wed Dec 28, 2011 12:34 am

What do you mean about the unique keys on the VSAM file? Records one and two show repeated key values. Is there something which is regarded as unique on the VSAM file? What order is it sorted in?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post