How to find 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
bhargav_dd
Premium Member
Premium Member
Posts: 57
Joined: Tue Jun 30, 2009 9:38 am

How to find Last Record.

Post by bhargav_dd »

Hi All,

I have a sequential file having some records say 20(This is not fixed it may change)..I need to get 20th record(last record of file) for loading into some other table..will that be possible with Transformer stage..if so how to do that..plss let me know if any of u have some solution..
Shaanpriya
Participant
Posts: 22
Joined: Thu Sep 11, 2008 11:47 pm
Location: Bangalore

Post by Shaanpriya »

Use tail stage to get the last 'n' number of records
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In your case, the last 1 record, and the tail stage must run in sequential mode so that it only extracts one "last" record.
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 »

Please learn how to copy/paste properly so we don't continue to get crap like this in your posts:
Ask a Question DataStage| The DataStage group is for the discussion of technical issues that arise during the installation or daily administration of IBM InfoSphere DataStage software.
Home | Invite Peers | More Data Warehouse Groups
I've removed it (again) but it is getting to be a nuisance. There's a pefectly lovely 'Preview' button you should use before posting to make sure your post will look good, give it a shot. Please.
Last edited by chulett on Fri Jul 16, 2010 9:29 pm, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jonamg
Participant
Posts: 10
Joined: Wed Feb 23, 2005 11:29 am

Post by jonamg »

Use Execute Command Sequence afte the reading the file you can execute the command tail -1 'filename' in it.
Post Reply