How do i get fisrt and last rows in windows environment

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

How do i get fisrt and last rows in windows environment

Post by reddy »

Hi Guys,

Good evening.
I need to get first and last record from input file having millions of rows.
In unix i know the command Head but here i am using Windows O/S.
Can you please give me suggestions.

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

Post by ray.wurlod »

There isn't one. Write your own, or get a "UNIX on Windows" (such as MKS Toolkit or CygWin) and use the UNIX commands.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Reddy

As Ray said "Write your Own" its easy.

Create a job in datastage itself to read a sequential file and in constraint have @INROWNUM =1 to one link. This will create the first record in the output file. Have another link directed to Aggregator and use the LAST option to write the last record to the next link. This will produce the last record.

The only draw back it is sequential and has to scan the entire file.

Thanks
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
shepli
Participant
Posts: 79
Joined: Fri Dec 17, 2004 9:56 am

Post by shepli »

:) If you use Aggregator, you can use both the FIRST and the LAST options.
Post Reply