Needs to remove duplicate words with in the column

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
uppalapati2003
Participant
Posts: 70
Joined: Thu Nov 09, 2006 2:14 am

Needs to remove duplicate words with in the column

Post by uppalapati2003 »

i have column contains data EX : "baby stroller baby toys blue stroller " from this i need to remove the word contains more than one time in this example "baby stroller " word are repeated i need to keep only first instance i need to populate out put as like " baby stroller toys blue " how i need to do this please any one can help in this
Srini
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only with a custom routine or Build stage. The algorithm (psuedocode) would look something like:

Code: Select all

resultarray initialized to empty
foreach word in string
   if ! (word exists in resultarray)
      add word to resultarray
   endif
end foreach
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