Of course you can, that's what the "-wait" is documented as doing. Your issue at first was the fact that the Sequence job always finished ok - now that it aborts, if what you want is the standard "0 else non-zero" rather than knowing exactly what happened then you just need to switch back to "-wait".
However, if you want "Finished (see log)" i.e. "finished with warnings" to be considered as "OK" then you'll need to stick with -jobstatus so you can tell the difference.
dsjob has status=0 even though job aborts
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Fri May 29, 2009 9:23 am
Whenever I used just the "-wait" I always got an exit code of zero - whether a job aborted or not. What I used "-jobstatus" or "-wait -jobstatus" then I get an exit code of 1 (OK), 2 (warning), or 3 (abort). Acceptable, but still not the more standard of 0 (OK), non-zero (not OK). No problem, I'll just program the script accordingly.
Thank you for you help. I appreciate it.
Thank you for you help. I appreciate it.
chulett wrote:Of course you can, that's what the "-wait" is documented as doing. Your issue at first was the fact that the Sequence job always finished ok - now that it aborts, if what you want is the standard "0 else non-zero" rather than knowing exactly what happened then you just need to switch back to "-wait".
However, if you want "Finished (see log)" i.e. "finished with warnings" to be considered as "OK" then you'll need to stick with -jobstatus so you can tell the difference.
Just want to reiterate that you use "-wait" OR "-jobstatus" and not the two of them together. The "-jobstatus" option is what is getting you the 1,2,3 (etc) return codes and "-wait" gets you zero or none-zero return codes. It's important to understand that it's not about "jobs" or "a job" aborting, it's about the job you specified on the command line aborting - i.e. your Sequence job and not any of the jobs it runs in this specific case and that should give you a non-zero return code.
If it doesn't work like that, then there's a bug in your particular version.
If it doesn't work like that, then there's a bug in your particular version.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers