Page 1 of 1

Comparing two files

Posted: Thu Jan 26, 2012 6:59 am
by vikibemech
I have two files (Seq1 & seq2) and need to compare two file with column name policy.

Seq File1
Policy_no
Type

Seq File2
Policy_no

I am comparing both policy_no and if matched then type should be XX Else YY. I am doing this logic (col1=col2 then xx else yy) in transformer and defining the logic in column Type but I am not getting correct results.

Any advice will be very much helpful.

Posted: Thu Jan 26, 2012 7:10 am
by chulett
First question - is this actually a Server job as you've marked it?

Secondly, what is your job design? How are you bringing two files in and comparing them "in transformer"?

Comparing two files

Posted: Thu Jan 26, 2012 8:19 am
by vikibemech
Yes it is server job.
Small change in design. It is not seq file instead it is hashed file.

hash 1 & 2 -> Transformer->hash file

Posted: Thu Jan 26, 2012 9:36 am
by chulett
OK, so off we go to the Server forum.

Since a transformer can't have two stream inputs, how are you bringing them in? HF1 is the stream input and HF2 is a reference input? Can we assume that 'policy number' is the key field in both hashed files and your reference lookup is based on that key? Please let us know if I've gotten anything wrong.

ps. Saying that you are "not getting correct results" doesn't really help us help you. What results are you getting? What's not working about whatever it is you are doing?

Posted: Fri Jan 27, 2012 12:34 am
by qt_ky
Copy and paste the exact logic from your job. Is there any chance you need to trim each column before comparing? One may have more leading or trailing spaces than the other.