Decoding value in transformer

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

Decoding value in transformer

Post by suresh.narasimha »

Hi All

I have a scenario here

Input :

Col 1, Col 2, Col 3
=============
1, abc, 123
1, abc, 123
1, abc, 456
2, def, 111
2, def, 112

Output :

Col 1, Col 2, Col 3
=============
1, abc, 1
1, abc, 2
1, abc, 3
2, def, 1
2, def, 2

Can please suggest how can I do this using stage variables ?

my source and targets are flat files.

Thanks in advance
Suresh
SURESH NARASIMHA
dwh.com
Participant
Posts: 22
Joined: Sat Jun 28, 2008 12:38 pm

Re: Decoding value in transformer

Post by dwh.com »

suresh.narasimha wrote:Hi All

I have a scenario here

Input :

Col 1, Col 2, Col 3
=============
1, abc, 123
1, abc, 123
1, abc, 456
2, def, 111
2, def, 112

Output :

Col 1, Col 2, Col 3
=============
1, abc, 1
1, abc, 2
1, abc, 3
2, def, 1
2, def, 2

Can please suggest how can I do this using stage variables ?

my source and targets are flat files.

Thanks in advance
Suresh

fren u have rowcompare previous routine..that will help u to get this kinda result...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you Search? How to use stage variables to "remember" values from the previous row has been discussed a bajillion times, I am sure that at least some of those deal with running counts.
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