How does filter command in sequential file stage work?
Moderators: chulett, rschirm, roy
How does filter command in sequential file stage work?
Hello,
How does filter command in sequential file stage work?
does it read each line in the specified input file and pass each line to the filter command using indirection and uses what ever is output by the filter command for processing, including any informational message?
I am presently trying to run a sort tool(syncsort) using the filter command and am getting the following error.
sorttest..Sequential_File_1.DSLink2: ds_seqopen() - Error in filter command "/tools/syncsort/bin/syncsort /silent /noprompt /end" -
[SyncSort HP-UX/LFS Rel. 3.6.0 Copyright (c) 2002 Syncsort Inc.]
when i use the same filter command and an indirection operator followed by the input file name at unix shell, it correctly prints the sorted data on the screen.
what am i doing wrong in the filter command?
thanks
Dhriaj
How does filter command in sequential file stage work?
does it read each line in the specified input file and pass each line to the filter command using indirection and uses what ever is output by the filter command for processing, including any informational message?
I am presently trying to run a sort tool(syncsort) using the filter command and am getting the following error.
sorttest..Sequential_File_1.DSLink2: ds_seqopen() - Error in filter command "/tools/syncsort/bin/syncsort /silent /noprompt /end" -
[SyncSort HP-UX/LFS Rel. 3.6.0 Copyright (c) 2002 Syncsort Inc.]
when i use the same filter command and an indirection operator followed by the input file name at unix shell, it correctly prints the sorted data on the screen.
what am i doing wrong in the filter command?
thanks
Dhriaj
Not really sure what might be wrong. All the Filter command does is execute the command as entered and the stage then reads 'standard out' as if it were a flat file (so to speak). So, yes, any informational or extraneous messages would be a problem.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
so do i also need to specify the input data file in the filter command ? does datastage not indirect the file specified in the sequential file stage to the filter command?chulett wrote:. All the Filter command does is execute the command as entered and the stage then reads 'standard out' as if it were a flat file
Thanks
Dhiraj
Nope, it doesn't do anything automatic with the normal 'Filename' in the stage. You are required to put something in there, but it's just to shut it up. I usually use "/dev/null" so it's obvious.dhiraj wrote:so do i also need to specify the input data file in the filter command ? does datastage not indirect the file specified in the sequential file stage to the filter command?
You need the complete command in the Filter option, including any redirection - just as if you were running it from the command line.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Interesting... that's not my understanding as to how it works or how I've been using it. I'd need to double-check the docs and play around a bit to have any more feedback on the subject.
If you've got it working that way, then great. Are you sure it actually did the sort?
If you've got it working that way, then great. Are you sure it actually did the sort?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Sort stage is primarily there as a marketing exercise; once upon a time Informatica beat up DataStage by observing that DataStage lacked a sort capability. So they put one in.
UNIX sort is faster than the DataStage one.
CoSort and SyncSort are faster still (faster, too, at emptying your budget).
UNIX sort is faster than the DataStage one.
CoSort and SyncSort are faster still (faster, too, at emptying your budget).
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.
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
Ray,
I seem to remember that version one of the SORT stage used a bubble sort algorithm written in BASIC, then it went to a bubble in C and then graduated into a hash bucket sort and I don't know what algorithm it utilizes now. The ones I've used in Px are certainly very, very fast and don't compare to the server version.
I seem to remember that version one of the SORT stage used a bubble sort algorithm written in BASIC, then it went to a bubble in C and then graduated into a hash bucket sort and I don't know what algorithm it utilizes now. The ones I've used in Px are certainly very, very fast and don't compare to the server version.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There should be no reason not to use sort as a filter in a Sequential File stage's Input link. You may need to specify stdin as the source file (as "-") for the command, and any key specification ("-k") must correctly match the metadata from your job design.
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.