Co:Z Batch Returning Override RC=12

Discussion of the COZBATCH utility for z/OS
Post Reply
jupam21
Posts: 12
Joined: Fri Dec 17, 2004 11:24 am

Co:Z Batch Returning Override RC=12

Post by jupam21 »

When using COZBATCH a z/OS Job is completing with the following
messages:

CoZBatchÝN¨: Copyright (C) 2005-2009 Dovetailed Technologies LLC. All right
CoZBatchÝN¨: version 1.5.2 2009-12-08
CoZBatchÝI¨: executing progname=login-shell="-/bin/sh"
CoZBatchÝI¨: process rc=exitcode=0
CoZBatchÝI¨: returning override rc=12
============================================
The last message 'returning override rc=12' is causing a Job completion code of '12'. This message is undocumented can you tell me what is causing it?

Thanks in advance
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

The override return code is specified using "$?=nn" in the PARM= string. Did you do this? Please post your JCL and we'll take a look.
jupam21
Posts: 12
Joined: Fri Dec 17, 2004 11:24 am

Post by jupam21 »

Yes, I checked the users JCL and they had the following coded:

PARM='/$?=12'


Thanks
Gopal
Posts: 1
Joined: Mon Feb 01, 2010 1:14 pm

Post by Gopal »

Following up on JUPAM21's question,

We need the cozbatch job to give us a fixed return code of 12 if there are any errors (syntax errors or logical errors) in the SFTP process...
If there were no errors, and the SFTP process was succesful, we want the job to have a return code of 0.

I've used the '//PSTEP01 EXEC PGM=COZBATCH,PARM='/$?=12'' in
my jcl, but the issue is that I'm getting a RC of 12 all the time from the job. Any thoughts ?


Thanks..
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Just check the exit code from cozsftp and if not zero, then exit with the return code that you want. The Co:Z Batch exit code will be used as the return code.

Example:

# insert after the cozsftp command:
if [ $? -ne 0 ]; then
exit 12
fi
Post Reply