Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Not able to set Return code to Zero

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 30
Location: India

PostPosted: Fri Aug 07, 2015 11:23 am    Post subject: Not able to set Return code to Zero
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 User


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

PostPosted: Fri Aug 07, 2015 11:44 am    Post subject:
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: 30
Location: India

PostPosted: Fri Aug 07, 2015 12:36 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 07, 2015 1:33 pm    Post subject: Reply to: Not able to set Return code to Zero
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: 30
Location: India

PostPosted: Fri Aug 07, 2015 1:59 pm    Post subject:
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 User


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

PostPosted: Fri Aug 07, 2015 5:10 pm    Post subject:
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: 331
Location: USA

PostPosted: Fri Aug 07, 2015 7:57 pm    Post subject: Reply to: Not able to set Return code to Zero
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us