Condition Code 0001

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

Condition Code 0001

Post by tombuch » Mon Jul 02, 2012 1:56 pm

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: 1772
Joined: Thu Jul 29, 2004 12:12 pm

Re: Condition Code 0001

Post by dovetail » Tue Jul 03, 2012 9:46 am

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