sequential stage filter command

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

sequential stage filter command

Post 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 ?
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Re: sequential stage filter command

Post by narasimha »

reachmexyz wrote: tail -1 test.
Loose the filename, and put only tail -1 as your Filter Command
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Re: sequential stage filter command

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
savis
Premium Member
Premium Member
Posts: 27
Joined: Tue Apr 15, 2008 11:06 pm

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Works fine for me. What exact version of DataStage do you have and what flavor of UNIX is it installed on?
-craig

"You can never have too many knives" -- Logan Nine Fingers
savis
Premium Member
Premium Member
Posts: 27
Joined: Tue Apr 15, 2008 11:06 pm

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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... :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply