Row Values Repetition

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have version 8.5, which has looping in the Transformer stage?

Even so, you don't really need it. Use stage variables to compare the current row with the previous row and, where the key value is the same and the other value is missing, use the other value from the previous row.

Make sure that your data are properly partitioned and sorted (on the key value).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

You need to change your logic slightly.

Use the below one.

sCurrentValue : If NullToValue(Input column,"")<> "" Then InputColumn Else sPreviousValue

sPreviousValue: InputColumn
Last edited by kondeti on Mon Feb 27, 2012 7:41 pm, edited 1 time in total.
Thanks
Kondeti
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Post by bicap »

Thank you Kondeti. It's working.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

You may run in to trouble if your first ColB of a group is null, Stage Variables can't be null so you would need to default to an empty string.

There may be a bit of intelligence in DS to default for you but have my doubts.

I have other concerns but irrelevant if it's working...
Post Reply