Search for a string

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ejazsalim
Premium Member
Premium Member
Posts: 51
Joined: Wed Apr 09, 2003 6:42 am
Location: VA, USA

Search for a string

Post by ejazsalim »

Friends,
I have a requirement where I need to build a complicated investigation output.

My Source file has 2 fields

Source File I:
Acctno, Acctstyl
--------------------
1, john doe and MARY DOE DBA DOE Garage
2, Andrew Watkins TRUST account
3, ABC Consulting Inc Account

Source File II:
SEARCH WORD
--------------------------
TRUST
ACCOUNT
DOE

OUTPUT file:
WORD,ACCOUNT
-----------------------------
TRUST,1
ACCOUNT,2
ACCOUNT,3
DOE,1

The output is the relationship between the word and account. Right now I am using ORACLE with the like statement after loading these files into a table to achieve this result but was wondering if anybody had a better suggestion ??

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Spell out your requirements in words, for some reason I can't make any sense out of your example. Also posting the Oracle SQL you mentioned should help as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could use the Index() function to check for each individual word. This would require hard coding "search file II" into your design.
You could parse the strings into separate rows with one word plus the account number per row (a pivot), and use a regular lookup.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply