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

How to code MAXCC in a JCL


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

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 4:30 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jul 24, 2008 4:42 am
Reply with quote

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
View user's profile Send private message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 4:48 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 5:11 am
Reply with quote

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
View user's profile Send private message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 5:26 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 5:40 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 5:46 am
Reply with quote

Hello,

You might look here:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/iea2b650/17.1.10.4?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 24, 2008 6:03 am
Reply with quote

Hi,

I have to disagree, // IF RC > 3000 THEN refers to any prior step and not previous step.


Gerry
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 7:06 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 24, 2008 7:14 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 7:53 am
Reply with quote

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 icon_wink.gif

d
Back to top
View user's profile Send private message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 1:23 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 24, 2008 1:27 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 1:28 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 24, 2008 2:35 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 24, 2008 2:45 pm
Reply with quote

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
View user's profile Send private message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 10:54 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 24, 2008 11:18 pm
Reply with quote

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
View user's profile Send private message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 26
Location: MONTEREY

PostPosted: Fri Jul 25, 2008 5:14 am
Reply with quote

Thanks All of you for your help !!!!
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 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
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top