View previous topic :: View next topic
|
Author |
Message |
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
|