Abort Job if Shell script fails

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
satishmelinamani
Participant
Posts: 7
Joined: Wed Jun 28, 2006 1:36 am
Location: Bangalore

Abort Job if Shell script fails

Post by satishmelinamani »

Hi All,

My requirement is to FTP few files with Current Date in file name (e.g.: File_Name_17_07_2007.sf). To achieve this I am calling a Shell Script in After Job Subroutine to FTP the file. But the problem is if by any reason ftp script fails my job has to abort, but this is not happening at this moment.

Please help me to force abort the job when shell script fails.


Thanks,
Satish
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Why not use the ExecSh built-in routine in the Routine activity from the sequence? This way you would be able check if the script executed successfully or not, based on which you can abort the job as well as the sequence.
------------------
Aneesh
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Pass back a non-zero return status from your script if anything goes wrong in it. The job will notice.
-craig

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