Page 1 of 1

Filtering top and bottom records from sequential file.

Posted: Mon Jul 11, 2005 9:10 pm
by atulghate
I have a file with below construct..

set schema abc
select field1, field2 from table xyz;
field1 field2
------ ------
100 abcd
101 abcd
111 mnop

3 record(s) selected

<EOF>


I have managed to use this file with removing first 3 and few bottom rows and just putting data in file manually.
Is there a way by which i can handle this in datastage itself.

Any help, suggestion would be much appreciated.

Thanks
Atul

Posted: Mon Jul 11, 2005 9:38 pm
by Kryt0n
Why would you want to do it in DataStage? A UNIX script would be more appropriate (and can be executed from DS if need be)

Posted: Tue Jul 12, 2005 2:24 am
by roy
Hi,
You could also use the filter command to be a sequential file's input and use a head and tail combination to do the same.

IHTH,

Posted: Tue Jul 12, 2005 3:01 am
by kerensho
Hello atulghate,

you can use the before job subroutine as Roy said.
if you do not want to use Unix commands at all thoug, you can read the file as a 1 column file (a large varchar) and then by transformer and constraints to filer out only the rows you want.

yours,
Keren

Posted: Tue Jul 12, 2005 4:40 am
by Sainath.Srinivasan
You can use DS to extract the rows from the dbms rather than landing in a seq file.

Posted: Tue Jul 12, 2005 4:06 pm
by atulghate
Thanks for all responces, scripting in before helped.