Execute Command Output

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
sigma
Premium Member
Premium Member
Posts: 83
Joined: Thu Aug 07, 2008 1:22 pm

Execute Command Output

Post by sigma »

Hi

I have the following command and the output of it is 3 (as there are 3 lines in the file)
$ wc -l *Rejects.txt | grep total | awk '{print $1}'
3
$

But when I use the above command in the execute command stage I get the following

Sequence job output

Process_Customer_Master..JobControl (@Command_To_Chk_Rejects): Executed: wc -l *Rejects.txt | grep total | awk '{print $1}'
Reply=0
Output from command ====>
wc: 0653-755 Cannot open *Rejects.txt.


Not sure why it cannot open the *Rejects.txt from within the stage

-rw-r--r-- 1 dsadm dstage 21 Oct 04 14:42 Arvind_Rejects.txt
-rw-rw-r-- 1 dsadm dstage 0 Oct 04 14:42 10_SalesPerson_Rejects. txt
-rw-rw-r-- 1 dsadm dstage 0 Oct 04 14:42 10_Country_Rejects.txt


The files are there with more then a fewlines

Any ideas?. It it typically to put this in a shell script and invoke the shell script or does it take the direct command

I have pasted the entire command on the command text box and nothing on the parameter

I was expecting a command output activity variable to have value 3 to help in downstrem testing

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

Post by ray.wurlod »

You're probably not executing in the same directory. Include a cd command in the commands executed from DataStage.
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 probably about it. That's the perils of using a relative path.
-craig

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