Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to code MAXCC in a JCL
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
kaushikmitra

New User


Joined: 11 Apr 2008
Posts: 23
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 4:30 am    Post subject: How to code MAXCC in a JCL
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
References
PostPosted: Thu Jul 24, 2008 4:30 am    Post subject: Re: How to code MAXCC in a JCL Reply with quote

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3081
Location: Charlotte,NC USA

PostPosted: Thu Jul 24, 2008 4:42 am    Post subject: Reply to: How to code MAXCC in a JCL
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: 23
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 4:48 am    Post subject: Reply to: How to code MAXCC in a JCL
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 5:11 am    Post subject:
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: 23
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 5:26 am    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 5:40 am    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

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

Hello,

You might look here:
http://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: 445

PostPosted: Thu Jul 24, 2008 6:03 am    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 7:06 am    Post subject: Reply to: How to code MAXCC in a JCL
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: 445

PostPosted: Thu Jul 24, 2008 7:14 am    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 7:53 am    Post subject: Reply to: How to code MAXCC in a JCL
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: 23
Location: MONTEREY

PostPosted: Thu Jul 24, 2008 1:23 pm    Post subject:
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: 2910
Location: Brussels once more ...

PostPosted: Thu Jul 24, 2008 1:27 pm    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7471
Location: 221 B Baker St

PostPosted: Thu Jul 24, 2008 1:28 pm    Post subject:
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: 445

PostPosted: Thu Jul 24, 2008 2:35 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2