Condition Code 0001

Discussion of the COZBATCH utility for z/OS
Post Reply
tombuch
Posts: 14
Joined: Tue Aug 10, 2010 7:02 am

Condition Code 0001

Post by tombuch »

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.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Condition Code 0001

Post by dovetail »

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:

Code: Select all

rc=$?
if test $rc -eq 1 ; then 
  exit 18
else
  exit $rc
fi
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.
Post Reply