IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Not able to set Return code to Zero


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Fri Aug 07, 2015 11:23 am
Reply with quote

Hello All

In one of my step i am checking if the file is empty or not using ICETOOL

Now i want to execute an email step if the file is not empty and if the file is empty i want to complete the job successfully.

i am using below

Code:
// IF  STEP#02.RC  < 5 THEN
//send email step
// ENDIF
//*
// IF  STEP#02.RC  = 12 THEN
//STEP#04  EXEC PGM=IDCAMS
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
 SET MAXCC = 00
//

When file is not empty its working fine and sending email.

But when my file is empty job throwing return code 12 not 00.
I want it to complete it with return code 00 if file is empty.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Aug 07, 2015 11:44 am
Reply with quote

Here is where it is important to know your release. Prior to z/OS 1.13, a job return code was the highest step return code in the job. In z/OS 1.13 you could use the JOB statement JOBRC parameter to influence the setting. The default is JOBRC=MAX - the old behavior. There are other options, best discovered in the JCL Reference manual for your release.
Back to top
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Fri Aug 07, 2015 12:36 pm
Reply with quote

Thanks Steve for your input !!!

I am now able to set return code to 00 using JOBRC.

But is there any other way to achieve this because i am not sure how this will behave in production.Also in our shop we don't move JCL to production with Job-card (its added by production control team) and JOBRC needs to be specified in Job-card.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 07, 2015 1:33 pm
Reply with quote

You'll have to talk to your Production Control and ask them how to do what you want (or think you want) to do.

IDCAMS can only set the RC/CC for the step which executes the IDCAMS.

If you can explain why you are getting non-zero values, and why you want to pretend they are zero, then there may be ideas.

Probably the simplest is to split your JOB into multiple JOBs, the last of which can only give zero (even if that is done using IEFBR14). That would allow you to control unexpected RC/CC values, and also produce zero for your expected non-zero values.
Back to top
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Fri Aug 07, 2015 1:59 pm
Reply with quote

Quote:
If you can explain why you are getting non-zero values, and why you want to pretend they are zero, then there may be ideas.


Hi Bill

I am getting non-zero value because of the step which checks file is empty or
not.If file is not empty then i want to execute the email step else just compete the job successfully.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Aug 07, 2015 5:10 pm
Reply with quote

vickey_dw wrote:
... I am getting non-zero value because of the step which checks file is empty or
not.If file is not empty then i want to execute the email step else just compete the job successfully.
This is why you have the JCL IF / THEN / ENDIF statements or the EXEC statement COND parameter. As with JOBRC, you can discover them in the JCL Reference manual. Many people find COND= pretty hard to understand despite the fact it's going to celebrate its golden anniversary in a year or two.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Aug 07, 2015 7:57 pm
Reply with quote

Quote:
I am getting non-zero value because of the step which checks file is empty or
not.If file is not empty then i want to execute the email step else just compete the job successfully.


If you are using ICETOOL to check if the file is empty, then you can always set the return code to 4 (instead of 8 or 12).

Then in the next step you need to check if ICETOOL returned 4 (meaning empty) don't run the mail step. If ICETOOL returned 0 then run the mail step.

Code:
COUNT FROM(IN) EMPTY RC4


Will that work?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top