Page 1 of 1

Synscort_Search for key in multiple columns of input file

PostPosted: Tue Dec 27, 2011 3:57 pm
by r rudram
(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!

Re: Synscort_Search for key in multiple columns of input fil

PostPosted: Tue Dec 27, 2011 4:28 pm
by BillyBoyo
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.

Re: Synscort_Search for key in multiple columns of input fil

PostPosted: Wed Dec 28, 2011 12:07 am
by r rudram
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!

Re: Synscort_Search for key in multiple columns of input fil

PostPosted: Wed Dec 28, 2011 12:34 am
by BillyBoyo
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?