Hi Support,
I have noticed that failed SFTP batch jobs either get cond code 0001 or 0255.
Is there a way to change the cond code 0001 to a higher number for example 0018?
We have batch job checks for condition codes greater than 0004 and this would help us out.
Thank you.
Condition Code 0001
Re: Condition Code 0001
Co:Z Batch will exit with a condition code equal to the last exit code from the shell script in DD STDIN.
So, if you are running a shell script with the cozsftp command then the last exit code is coming from cozsftp. As you have seen, the OpenSSH sftp command, upon which cozsftp is based, exits with either a 0, 1, or 255. If you want to change the exit code from COZBATCH, you can add something like this to the end of your STDIN shell script:
More information on the z/OS Unix shell scripting commands can be found under "man sh" or in the z/OS Unix Command Reference under the "sh" command.
So, if you are running a shell script with the cozsftp command then the last exit code is coming from cozsftp. As you have seen, the OpenSSH sftp command, upon which cozsftp is based, exits with either a 0, 1, or 255. If you want to change the exit code from COZBATCH, you can add something like this to the end of your STDIN shell script:
Code: Select all
rc=$?
if test $rc -eq 1 ; then
exit 18
else
exit $rc
fi