Page 1 of 1

Syncsort

PostPosted: Wed Jan 16, 2013 2:41 pm
by Gouthami_12
Hi,

I have 2 input files.

IP1:

AB000AB00001 XXXX APA
AB000AB00002 XXXX APA
AB000AB00003 XXXX APA
AB000AB00004 XXXX APA

IP2:

AB000AB00001 XXXX APB
AB000AB00003 XXXX APB
AB000AB00004 XXXX APB
AB000AB00005 XXXX APB

My o/p should be

OP1:

AB000AB00001 XXXX APA
AB000AB00001 XXXX APB
AB000AB00003 XXXX APA
AB000AB00003 XXXX APB
AB000AB00004 XXXX APA
AB000AB00004 XXXX APB

OP2:

AB000AB00002 XXXX APA
AB000AB00005 XXXX APB

My output file should be exactly the same as i have posted here. The record in my second input file(IP2) must be written to the second row of my first output file (OP1)

Is this possible using syncsort? :)

Re: Syncsort

PostPosted: Wed Jan 16, 2013 3:36 pm
by BillyBoyo
You want matches between files on one output file, and mismatches on another output file, whether from file 1 or file 2.

Can you have duplicate keys on either file?

Re: Syncsort

PostPosted: Wed Jan 16, 2013 4:28 pm
by Gouthami_12
Position 6-12 is the key field. whenever the key matches, the matched records need to be written to my OP1 from both input files file 1 and file 2.

No duplicates in both the files

Re: Syncsort

PostPosted: Thu Jan 17, 2013 2:14 pm
by Gouthami_12
Can anyone help me on this??

Re: Syncsort

PostPosted: Thu Jan 17, 2013 5:27 pm
by enrico-sorichetti
You should remember that answering to questions is ...

on voluntary base
on our own time
free of charge

in other words when and if we feel like

soliciting for answers is quite improper
even more after such a short time interval
last useful post at Wed Jan 16, 2013 12:58 pm
useless post Thu Jan 17, 2013 10:44 am

there is no commitment to reply
there should be NO EXPECTATION for answers

if there is a strong need for an answer a forum might not be the best place to ask

Re: Syncsort

PostPosted: Thu Jan 17, 2013 5:44 pm
by BillyBoyo
You need to use JOINKEYS.

You need a REFORMAT.

You will need to test the first byte of each source record on the REFORMAT record, if either is blank, you have a mismatch, else you have a match.

There are examples here if you search.