Removing of special keywords from a field

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
nasimul
Participant
Posts: 37
Joined: Wed Jan 25, 2006 1:38 am

Removing of special keywords from a field

Post by nasimul »

Hi,
We need to remove keywords like Jr, Sr, II, III etc from a field.

For example:
"Richard Headley SR" should be changed to "Richard Headley"
"Richard SR Headley" should be changed to "Richard Headley"
"Sr Richard Headley" should be changed to "Richard Headley"
"Siva Sriram" should be kept as "Siva Sriram" -- Here we have "sr" but it didn't replace that.
"Sriram Krishnan" should be kept as "Sriram Krishnan"

Our requirement will have at least 50 diffrent keywords.
Please provide the way to implement this functionality.

Thanks,
Nasimul
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

QualityStage will do this for you, and it is a part of the product at V8.
vkhandel
Participant
Posts: 35
Joined: Wed Oct 04, 2006 12:12 am
Location: Pune

Re: Removing of special keywords from a field

Post by vkhandel »

Can u store all the keywords in a sequential file?

If yes, then u can write a Job Control (In a server job)... wherein u will traverse the sequential file in a loop (taking one keyword at each time) and storing it in the seesion.

Then, u can call a parallal job from the job control, which has in its input the keyword (already set in session)... and u can look for the keyword in the Transformer Stage using the Index command , which will return the position of the keyword in the string.... and if the search keyword is not found it will return 0.

So you have all records with index position of keyword, which can be removed using the field_name[index_position,length of keyword] command.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

U is not encountering the problem; Nasimul is.

The second person personal pronoun in Engish is spelled "you".
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