Page 1 of 1

SYNCTOOL or SYNCSORT Join Question

PostPosted: Fri Jul 23, 2010 4:34 am
by bcdgall
I was trying to use a splice to do this operation Syncsort or SyncTool code but have not had success.

I have 2 files which consist of the following
ID 5 bytes long starting position 1
Space 1 byte long
Type of Id 3 bytes long
Space 1 byte long
Id Count 5 bytes

SBA File sample
1234 SBA 00001
12578 SBA 00005
126 SBA 00003 <-- not in INV file

INV File sample
1234 INV 00001
124 INV 00006 <-- not in SBA file
12578 INV 00005

These conditions can occur
The INV file may not have a matching Id Count for the same Id in the SBA file
The SBA file may not have a matching Id Count for the same Id in the INV file

The resulting file is to be

SBAINV File sample
1234 SBA 00001 INV 00001
124 SBA 00000 INV 00006 <-- Since INV Id does not exist in SBA file create place holder with count of zero
12578 SBA 00005 INV 00005
126 SBA 00003 INV 00000 <-- Since SBA Id does not exist in INV file create place holder with count of zero

So basically if an ID exists in one file and not in the other it should also be put into the output file with a count
value of zero for its ID

thanks
Dave

Re: SYNCTOOL or SYNCSORT Join Question

PostPosted: Thu Jul 29, 2010 12:58 am
by arcvns
1234 SBA 00001
As per your post, ID is 5 bytes long, but the above record shows only 4 bytes!