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
Filter Option in Sequential File
Moderators: chulett, rschirm, roy
Filter Option in Sequential File
gikjpjj
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
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.
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.