Replace 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
kumar66
Participant
Posts: 265
Joined: Thu Jul 26, 2007 12:14 am

Replace String

Post by kumar66 »

Hi All,


I have a requirement where the last field in a row needs to contain unique value

for e.g.
input

aaa,rrrr,1|2|1|3
bbb,eee,1|2|2|3

output:
aaa,rrrr,1|2|3
bbb,eee,1|2|3

Please advise.

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

Post by chulett »

What have you tried?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar66
Participant
Posts: 265
Joined: Thu Jul 26, 2007 12:14 am

Post by kumar66 »

I tried by breaking the last filed through looping and remove duplicate on the entire row so no two rows are loaded.

But trying to find out to replace rather than breaking the field.

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

Post by chulett »

I don't believe you have any other option here. I don't see a way off the top of my head to do any kind of intelligent "replace string" to remove randomly placed duplicate values.
-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 »

I don't think there's a solution without creating a routine.

In a routine you can do whatever you're skilled enough to accomplish programmatically.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

pivot > remove duplicate > vertical pivot
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

but please check if it fits in to your situation.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Off the top of my head, I'm thinking transformer loop, Field, reconstruct with dedupe inside the loop, push out on end of loop.
Post Reply