Hello,
Is there a command option with the "dsjob" used reseting jobs if required and the execute??
Thanks in advance,
Frankie 22''
Command for reseting jobs if required and the execute
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 21
- Joined: Thu May 31, 2007 8:58 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, this is only available in sequences.
However you could script dsjob -jobinfo to determine the job's status then dsjob -run -mode RESET if necessary then dsjob -run -mode NORMAL to actually run the job. (Option -mode NORMAL can be omitted.)
However you could script dsjob -jobinfo to determine the job's status then dsjob -run -mode RESET if necessary then dsjob -run -mode NORMAL to actually run the job. (Option -mode NORMAL can be omitted.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Here is a code snippet.
Code: Select all
# -----------------------------------------------------------------
# Check current job status here
# -----------------------------------------------------------------
DsJobStatus=`$DSPath/dsjob -jobinfo $ProjectName $JobName | head -1 | cut -d"(" -f2 | cut -d")" -f1`
case $DsJobStatus in
# -----------------------------------------------------------------
# 0 "Running"
# -----------------------------------------------------------------
0)
print " ERROR: Job $JobName already running."
exit 1
;;
# -----------------------------------------------------------------
# Runnable Job Status (do nothing)
# 1 "Finished"
# 2 "Finished (see log)"
# 9 "Has been reset"
# 11 "Validated OK"
# 12 "Validated (see log)"
# 21 "Has been reset"
# 99 "Compiled"
# -----------------------------------------------------------------
1|2|7|9|11|12|21|99)
:
;;
# -----------------------------------------------------------------
# NOT Runnable Job Status (reset job)
# 0 "Running"
# 3 "Aborted"
# 8 "Failed validation"
# 13 "Failed validation"
# 96 "Aborted"
# 97 "Stopped"
# 98 "Not Compiled"
# -----------------------------------------------------------------
*)
$DSPath/dsjob -run -mode RESET -wait -jobstatus $ProjectName $JobName
ReturnCode=$?
if (( $ReturnCode==21 ))
then
:
else
print
print " ERROR: Unable to reset job $ProjectName $JobName"
exit 3
fi
esac
Mamu Kim