Page 1 of 1

sequential stage filter command

Posted: Tue Jan 13, 2009 9:53 am
by reachmexyz
HI

I have a file with 2 rows and 1 columns
ex file:
qwerty
asdfgh

these are stored in filename test

Now i want to read only second row.
So i have enabled filter command and input the command as
tail -1 test.
It says filter command error

What should i input ?

Re: sequential stage filter command

Posted: Tue Jan 13, 2009 9:57 am
by narasimha
reachmexyz wrote: tail -1 test.
Loose the filename, and put only tail -1 as your Filter Command

Re: sequential stage filter command

Posted: Tue Jan 13, 2009 10:35 am
by reachmexyz
narasimha wrote:
reachmexyz wrote: tail -1 test.
Loose the filename, and put only tail -1 as your Filter Command
I did but still its not working

in the filter command i just put tail -1 also i have tried 'tail -1',`tail -1'
Nothing is working

Posted: Tue Jan 13, 2009 10:42 am
by chulett
You need the fully pathed filename in the filename box and "tail -1" in the Filter, without any quotes. And explain what "not working" means - what do you get? An error?

Posted: Tue Jan 13, 2009 12:43 pm
by savis
Please find the error message below:

DSBrowser..Sequential_File_0.DSLink2: ds_seqopen() - Error in filter command "tail -1" -
DSBrowser..Sequential_File_0.DSLink2: ds_seqopen() - Error in execv() - No such file or directory
DSBrowser..Sequential_File_0.DSLink2: DSD.SEQOpen GCI $DS.SEQOPEN error 11.

Commands Used:
Filename:
<full path>/Test.txt
Filter command:
tail -1

I am able to view the data from the file when the filter command is not used.

Please help

Posted: Tue Jan 13, 2009 12:52 pm
by chulett
Works fine for me. What exact version of DataStage do you have and what flavor of UNIX is it installed on?

Posted: Tue Jan 13, 2009 1:12 pm
by savis
chulett wrote:Works fine for me. What exact version of DataStage do you have and what flavor of UNIX is it installed on?

datastage version: 7.5

Unix details:
uname -a
SunOS livdsapps16 5.9 Generic_122300-11 sun4us sparc FJSV,GPUZC-M

Posted: Tue Jan 13, 2009 1:14 pm
by chulett
So, the original 7.5.0 release and not something "more recent" like 7.5.1a? If so, you may need a patch or to upgrade for this to work. Check with your official support provider.

Posted: Tue Jan 13, 2009 2:53 pm
by ray.wurlod
WHERE is the file? Unless it's in the project directory on the server you need to specify the pathname of the file.
tail -1 /usr/data/test

Posted: Tue Jan 13, 2009 4:14 pm
by chulett
I've already noted that and they've shown they are using a full path to the file:
Commands Used:
Filename:
<full path>/Test.txt
Filter command:
tail -1
They've also noted that removing the filter and just using the full path works fine and reads all records. So hopefully we're past the invalid path and/or filename and/or permissions part of this problem.

Trying to remember if there were issues with the filter option in 'earlier' versions... :?

Posted: Tue Jan 13, 2009 5:34 pm
by ray.wurlod
No, you can't do it that way. The file pathname must appear in the filter command itself, the actual File Name property is ignored, and DataStage reads stdout of the actual (given) filter command.

Posted: Tue Jan 13, 2009 10:15 pm
by chulett
No, that's not true and I believe we've had this conversation before. The filename property is required, is not ignored and it works just fine as I posted as the stage automatically combines the two. Come on, give it a try, you'll see.