Filter Option in Sequential File

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
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Filter Option in Sequential File

Post by 199542 »

Hi All ,
I am facing a problem in using filter option in sequential file .Suppose i am using head -1 in the filter property of output tab, I am not able to see any difference in the ouput .....
I tried with 'sed' command also ....still same result ....
Can anybody help regarding how to use this property ??

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

Post by ray.wurlod »

Your head -1 command needs to be followed by the file name. The Sequential File stage reads stdout of the command rather than reading the file and applying the filter command to it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Post by 199542 »

ray.wurlod wrote:Your head -1 command needs to be followed by the file name. The Sequential File stage reads stdout of the command rather than reading the file and applying the filter command to it. ...

Hi ray ,
Thank you for your reply .Still i am facing the same problem even though i specified as you suggested head -10 filename

I know that we can use external filter .But , i want to know how this filter option can be used ??

Is there any other way to use this filter option in Sequential stage.?

Thank you all in advance .
gikjpjj
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

You don't need to include the filename as part of the filter command. Each record is passed to the command via a pipe, with the output from the command being piped to DataStage. The file used is that which is defined in the 'File' property.

I just confirmed my understanding by creating a job with a sequential fie stage, checking I could read a file using the 'View Data' button, then applying a filter of 'head -1'.

I found that with the filter I only viewed one record, whereas all records were shown without the filter.

Make sure you can 'View Data' the file correctly before applying a filter, and check you have correctly set up the file format e.g. UNIX line terminator etc.
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Lets try this head 10 < filename
RD
Post Reply