First and last record

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
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

First and last record

Post by vamsi_4a6 »

I have to fetch last record from a file but i do not want to execute the stage in sequential mode.i want to execute stage in parallel mode only.


Current logic i am following.

sequentialfile-->tail stage

or

sequentail file-->transformer stage(lastrow function as constraint).



both tail stage and transfomer stage i am running in sequential mode but i am thinking whether we can do samething by using by executing the stage in parallel mode
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sure, if what you want is the last record FROM EVERY 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.
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

Post by vamsi_4a6 »

Thanks for reply but is it possible get last record only by executing stage in parallel mode and after that i can use some transformation to get last record alone from the file
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sure, if what you want is the last record FROM EVERY 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, no.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Is the purpose of the job to only get the last row of an input file?

If so, just use the unix cmd tail -1 on the filter in the sequential file stage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You do not know, in a parallel execution environment, which node is processing the last row of the file, unless there is some particular characteristic of the data from that line that allows it to be thus identified.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Been wondering the same thing, all of this conversating about "last record alone" - if that's all you need just use tail -1 as noted and never mind about all this parallel mode stuff.

Oh, and... whatever happened to the "first record" you mentioned in your subject?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply