'call DSExecute' does not work in job control

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
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

'call DSExecute' does not work in job control

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

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

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

it did work

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

Post by chulett »

No problem... it's all part of the learning process. :wink:
-craig

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