View previous topic :: View next topic
|
Author |
Message |
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Hi ,
How to code the maximum return code in JCL . I did the below -
IF ABEND | MAXCC > 3000 THEN
some JCL code here ......
//ENDIF
But the JCL could not identify MAXCC. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm pretty sure that MAXCC isn't a valid parameter for an IF/THEN/ELSE check. You need to stick with RC. |
|
Back to top |
|
|
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Then is there any way out for this. All I want is that if any of the job step has return code more than 3000 (i.e. the MXCC of the JCL > 3000) then the logic inside IF/THEN should execute. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
if any of the job step has return code more than 3000 (i.e. the MXCC of the JCL > 3000) |
I believe much of your problem is your understanding of the terminology.
RC and MAXCC are not the same thing.
If your code sets a return code, the jcl can check it. There is no need to also talk about maxcc. MAXCC is not something referred to by jcl. |
|
Back to top |
|
|
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Requirement is -
If RC of any step in the JCL is > 3000 then the job should write a message in a output file.
For that I added a step in the last of the JCL -
// IF RC > 3000 THEN
But that does not work out as RC only refers to the return code of the previous step. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
If RC of any step in the JCL is > 3000 |
Then using COND may better suit your need.
Quote: |
But that does not work out as RC only refers to the return code of the previous step. |
Why do you believe this? I believe your understanding of this is incorrect also. Have you looked in the JCL manual? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I have to disagree, // IF RC > 3000 THEN refers to any prior step and not previous step.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Gerry,
Yup, that was the reason for my prior 2 posts. . . The first was to offer an alternative to IF/THEN as it was not understood. The second to an example of IF/THEN showing what you said. I may have gone the long way around.
Hopefully, this will help. . .
d |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Dick,
actually I missed this
Quote: |
Why do you believe this? I believe your understanding of this is incorrect also. Have you looked in the JCL manual?
|
My apologies.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Gerry,
Not to worry - i've been known to mis-speak and/or mis-type. . .
For my $.02, i'd rather someone jump in
d |
|
Back to top |
|
|
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Hi Dick and Gerry
Thanks for your replies...
I tried the JCL with COND . Here is what I coded in the JCL in the last step -
//STEP03 EXEC PGM=IEBGENER,COND=(3000,GT)
//SYSUT1 DD *
JOB XXXXXXXX HAS ABENDED
/*
//SYSUT2 DD DSN=XXXX.XXXXXX.XXXXX.XXXXX,DISP=MOD
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
One of the previous steps in the JCL abended with a return code of U3002.
I was expecting this will trigger my above step as 3002 is greater than 3000. But that step flushed out and did not execute. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Aaaaaaaaah, an abend is an abend not a return code.
You could try to code COND=(ONLY,(3000,GT)) to cater for an abend |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
A user abend is neither a return code nor a maxcc. It is an abend. No conditon code check will test if an abend occurred.
Look up COND=ONLY in that JCL manual and see if this will help with what you need. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
there is another issue here when using COND=(3000,GT)
Quote: |
The COND parameter is used to specify the return code tests that MVS
will perform to see if a job step will be executed or not. Before a
job step containing a COND= parameter is executed, MVS performs the
COND parameter test(s) specified against the return codes from all
prior job steps or the steps named on the COND= parameter. If none
of these tests is satisfied, the system executes the job step; if
any test is satisfied, the system skips the job step on which the
COND= parameter is coded.
|
Hence if any other step returns a rc LE 3000, the last step will flush, if any test is satisfied the STSTEM SKIPS the job step on which the COND= parameter is coded.
Unlike the IF/THEN which will run the step if any prior step has a RC GT 3000
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Gerry, good spot.
I'd forgotten that the RC checking will be satisfied if only one previous RC was LE 3000.
Just had a look at the example linked by Dicks post, which seems a good way to go. I guess that using IF/THEN/ELSE that you can combine abend checking with RC checking too. |
|
Back to top |
|
|
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Thanks all for the help so far ...
I have run the job with COND=(ONLY,(3000,GT)) as suggested by expat.
Only one problem I am facing if any prior step gets a JCL error , my abend step - //STEP03 EXEC PGM=IEBGENER,COND=(ONLY,(3000,GT))
does not run.
What is the return code (RC) of the job in case of JCL error. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You cannot test for prior jcl error(s).
You need to set up your jcl so that (after testing is complete) there will be no jcl errors.
There should never be a jcl error in a production job. |
|
Back to top |
|
|
kaushikmitra
New User
Joined: 11 Apr 2008 Posts: 26 Location: MONTEREY
|
|
|
|
Thanks All of you for your help !!!! |
|
Back to top |
|
|
|