Multiple replace in one statement

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
asyed
Participant
Posts: 16
Joined: Sun Dec 12, 2010 10:24 pm
Location: Hyderabad, India

Multiple replace in one statement

Post by asyed »

Hi All,

I have a requirement where I need to perform replace of certain pattern in the entire string.

For eg:

Code: Select all

+Type abc +Type def +Type ghi
I want to replace this with:

Code: Select all

abc=Type-abc, def=Type-def, ghi=Type-ghi
Do I have to go for a routine (or) is there a way that this could be implemented in a single statement as the pattern is repetitive.
FYI - The number of times TYPE repeats is unknown.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Multiple replace in one statement

Post by SURA »

I am not sure about "one statement"

Do you mean in a single record?

I trust, it can be handled with the help of stage variables.

DS User
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Given the variable number of repeats, this may be able to be accomplished not with stage variables but with loop variables in a Transformer stage. You need at least version 8.5 for this functionality.
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