how to get the N th row

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
nareshketepalli
Participant
Posts: 36
Joined: Mon Jun 28, 2010 11:24 pm
Location: seepz

how to get the N th row

Post by nareshketepalli »

how to get the N th row in data stage?


Regards,
NARESHKUMAR
MT
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 09, 2007 3:51 am

Post by MT »

Hi,

with a transformer!

Short question - short answer :-)
regards

Michael
nareshketepalli
Participant
Posts: 36
Joined: Mon Jun 28, 2010 11:24 pm
Location: seepz

Post by nareshketepalli »

can u tel me the procedure
NARESHKUMAR
MT
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 09, 2007 3:51 am

Post 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
regards

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

Post 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.
-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 »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nareshketepalli
Participant
Posts: 36
Joined: Mon Jun 28, 2010 11:24 pm
Location: seepz

Post by nareshketepalli »

Thankyou
NARESHKUMAR
Post Reply