Matching the records

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Matching the records

Post by sourabhverma »

Hi All,

I am having some 1 millions of records(Source) having 4 fields and I have another reference table of 3 fields containing some 6-7K of records.

The structure of Source table is something like:
Field1, Field2, Field3, Field4
004960239674199,4921316782,SI025308,LNAZHADE
0034918382252,5939793841,ZHALNADE,SI017501
and so on........

And the structure of reference table is :
Field1, Field2, Field3
ABC, Test1, 49679
ABC, Test2, 493
ABC, Test3, 492
.
.
.
BCD, Test, 482
and so on.....

My requirment is that i need to match the field2 of input source with field3 of reference table in the way that Field3 of reference table exists somewhere in the begining of the field2 of source input. In the above example the output shul be like :

004960239674199,4921316782,SI025308,LNAZHADE,ABC, Test3
0034918382252,5939793841,ZHALNADE,SI017501,,

I have got this logic working in perl but because the performance is not as per requriment i wanted to perform same thing in datastage.

So can anyone suggest how to achieve this in datastage, any help is appeciated.

I hope i am clear in explaining the requirment.
Thanks,
Sourabh Verma
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Server job. ODBC stage using user-defined SQL on the reference input to a Transformer stage. Use the LIKE operator in the user-defined SQL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post by sourabhverma »

Hi Ray,

Thanks for the reply, the problem with LIKE operator is that data can have any pattern and i don`t know about the actual string.
Thanks,
Sourabh Verma
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

Post by Shruthi »

Take the count of Field 3 in reference link and put it in one column, say A1.

In Transformer, extract srcA[1,A1] - extract the required substring and then do a lookup again to do comparsion.

Hope this works
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post by sourabhverma »

I got it done done by having certain number of lookup (rejects link). I had input source & created required numbers of copies of reference data & matched in the respective lookup.
Thanks,
Sourabh Verma
Post Reply