DataStage not returning the return code to Unix

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
Aparna_A
Participant
Posts: 21
Joined: Wed Nov 09, 2005 11:16 pm

DataStage not returning the return code to Unix

Post by Aparna_A »

Dear all,

We are using Unix Shell Scripts as the Wrapper for all our parallel jobs (around 20-25 jobs). Once we trigger the script, when the load is too heavy, it takes around 3 hours for the entire process to finish. We have observed that in such scenarios, after about 2 hours, even though the job that is currently running is successful, the return code is not being received by the Unix session, and as a result it is not kicking off the next job in the Sequence. Is it because of any UNIX session time-out issue?
Pls. let me know.
Aparna
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

HI Aparna,

We had a similar problem of unix box not returning the return code to datastage sequencers. But we could not diagnose whether really the Unix OS was not sending the message or Datastage Sequencers were not able to read it.

We made a trick in the unix script. We kept is send return codes at a periodic intervals. This worked

Regards
Sreeni
Aparna_A
Participant
Posts: 21
Joined: Wed Nov 09, 2005 11:16 pm

Post by Aparna_A »

Hi Sreeni,

Can you pls. elaborate on your suggestion.

When UNIX triggers a DS Job, the control shifts to DataStage, how do I keep sending any Status Codes to UNIX before the Job Running is successful/aborts.
Aparna
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Can you post the script to see what you are doing.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
morkane@hotmail.com
Participant
Posts: 9
Joined: Mon Nov 28, 2005 2:30 pm

Here's how: from a Unix script call the following function

Post by morkane@hotmail.com »

function GiveDStgjobstatus {

typeset exitcode

# invalid number of arguments given

exitcode=99

if [ $# -eq 1 ]
then
case "$1" in
1)
exitcode=0
;;
*)
exitcode=1
;;
esac
fi

if [ $# -eq 2 ]
then
case "$2" in
0)
case "$1" in
1)
exitcode=0
;;
*)
exitcode=1
;;
esac
;;
1)
case "$1" in
1)
exitcode=0
;;
2)
exitcode=0
;;
*)
exitcode=1
;;
esac
;;
*)
# invalid argument option -- should be 1 for yes and 0 for no
exitcode=98
;;
esac
fi

return $exitcode

}




Put the following at the end of your unix script calling your Dtage job

GiveDStgjobstatus $?
exitvalue=$?
exit $exitvalue
Kanem
Post Reply