How to process only last 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
rajan.n
Premium Member
Premium Member
Posts: 96
Joined: Mon Oct 09, 2006 7:47 am

How to process only last row

Post by rajan.n »

Hi all,
my req is as below.
the data comes in to the transformer as below:
no. name

1 a
2 a
3 a
4 a

so here i want only the last row
is there any option to give like only last row to be processed in transformer or the largerst num to be extracted in the
since i need the largest number ie 4 , so i need to place them in target as
4 a , that's it.
thnx much in advance.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

try using Tail stage.

if you want to largest number only to execute, Sort it 1st then use tail ..
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Not in transformer, but using either Sort or Aggregator stage. You can group based on 'name' and find the max of 'no'.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
rajan.n
Premium Member
Premium Member
Posts: 96
Joined: Mon Oct 09, 2006 7:47 am

Post by rajan.n »

hey keshav..thanks a lot..
i have used tail stage ..it worked sucessfully
and one more thing is..i specifies sequential mode in transformer..so the rows were in sequence there is no need for sort for me....
thanks a lot for ur sujetion it was a timely help.

kumar:
hi kumar,
thanks a lot for ur responce..
i wil also try this method ( if i get any issues with the above logic)

keshav0307 wrote:try using Tail stage.

if you want to largest number only to execute, Sort it 1st then use tail ..
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

Hi, just before transformet u can use sort stage by sorting ascending.and again in next Aggregatator stage u can use max of the no to find out the greatest and i think i will definitely do for u.Please let us know ...did it worked???

Thanks
ambasta
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Etiquette Note

It was not u who posted the question, it was rajan.n

Had you wanted to use a pronoun, the one you were seeking was "you".
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