Resetiing a job via shell script

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
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Resetiing a job via shell script

Post by sjordery »

Hi All,

I have a scheduled data stage job run via below script on daily basis.

#! /usr/bin/sh
dshome=`cat /.dshome`;
export dshome
PATH=$PATH:$dshome/bin;
export PATH
. $dshome/dsenv

dsjob -run -param source_file=$1 Test_Project Seq_job.$2

Some times the job gets aborted due to avoidable issues like file didnt land because of market holiday yesterday.

So is it possible to add any command in the same script to reset the sequence job and all the jobs called from the sequence job if it has aborte last time?

Thanks in advance.
Sjordery.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

dsjob -run -mode RESET
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

Thanks ArndW.
I tried that but its prompting with error

'Status code = -2 DSJE_BADSTATE
Error running job"

Does the command resets all the jobs called from the sequence jobs along with the main sequence job?
below is the script I am using.

-------------------------------------------------------------------------------------
#! /usr/bin/sh
dshome=`cat /.dshome`;
export dshome
PATH=$PATH:$dshome/bin;
export PATH
. $dshome/dsenv

dsjob -run -mode RESET -param source_file=$1 Test_Project Seq_job.$2

-------------------------------------------------------------------------------------

Thanks,
SJordery.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You need 2 separate calls, the first to RESET, then the 2nd to run.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And no, it only resets the job mentioned on the command line, no others automagically. Your Sequence job should be setup to do the resetting of any 'child' jobs it runs using the 'Reset if required then run' option in the Job Activity stage.
-craig

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