Page 1 of 1

how to get the N th row

Posted: Thu Mar 17, 2011 3:08 am
by nareshketepalli
how to get the N th row in data stage?


Regards,

Posted: Thu Mar 17, 2011 3:30 am
by MT
Hi,

with a transformer!

Short question - short answer :-)

Posted: Thu Mar 17, 2011 3:36 am
by nareshketepalli
can u tel me the procedure

Posted: Thu Mar 17, 2011 6:19 am
by MT
Yes.

Use stage variables and build a counter like
svCounter + 1 => svCounter
and the you build a condition to your output link svCounter = N

Posted: Thu Mar 17, 2011 6:39 am
by chulett
There's also the @INROWNUM and @OUTROWNUM system variables that can be leveraged. All solutions need to take your paritioning into account as you would be capturing the Nth row per node otherwise.

Posted: Thu Mar 17, 2011 4:03 pm
by ray.wurlod
Head stage (N rows) followed by Tail stage (1 row). There's always more than one way. Note that, in parallel execution, any of these methods will give you the Nth row on each node.

Posted: Thu Mar 17, 2011 10:40 pm
by nareshketepalli
Thankyou