Page 1 of 1

'call DSExecute' does not work in job control

Posted: Thu Nov 30, 2006 11:22 pm
by changming
hi,
I have one datastage job, in it's job control, I add one command as below
Call DSExecute("UNIX", "ascript.sh", Output, SystemReturnCode)
then I compile and run the job. the ascript.sh should create a new file in my unix direcroty. after the job finish, I can not see any file created.
then I changed the ascript.sh to myascript.sh, which does not exist at all. the run can be complie and run succesfully. thus, I believe the Call DSEcute command did not run at all. any one please tell me why it did not run and how to let it run? thanks

Posted: Thu Nov 30, 2006 11:36 pm
by chulett
It works just fine, it just sounds like you're not checking to see if your script had any issues when it ran.

You need to check and see if your SystemReturnCode variable came back with a zero or non-zero value. You need to check the contents of your Output variable, which is where anything the script echoes to standard out or standard error would be captured. Both can be easily logged by calling DSLogInfo so the information is in the job's log and accessable post run.

Posted: Thu Nov 30, 2006 11:46 pm
by ray.wurlod
Your PATH (as the DataStage user) probably did not include the parent directory of the script. Give the full pathname of the script.

DSExecute() has worked perfectly well since version 1.0.

Beware that a script to create a directory will fail if the directory already exists. You may need to include a test for existence.

it did work

Posted: Thu Nov 30, 2006 11:54 pm
by changming
chulett
thanks for your advice. It did work . in the script I will run , just two commands. such as
echo "helo world"
touch HelloWorld.flg
I made a very stupid mistake, I did define the directory the file should be created. when I could not find the file, I thought the script was not excuted. thanks again.

Posted: Fri Dec 01, 2006 12:04 am
by chulett
No problem... it's all part of the learning process. :wink: