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
 

 

How to code MAXCC in a JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    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

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, 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: 26
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

Site Director


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

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: 26
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

Site Director


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

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

Site Director


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

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: 1703
Location: Australia

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

Site Director


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

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: 1703
Location: Australia

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

Site Director


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

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: 26
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: 8593
Location: Back in jolly old England

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

Site Director


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

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: 1703
Location: Australia

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
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

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

Site Director


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

PostPosted: Thu Jul 24, 2008 11:18 pm    Post subject:
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    Post subject:
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    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 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
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
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm
No new posts Problem Compiling cobol code with Cob... amitc23 COBOL Programming 2 Wed Aug 24, 2016 1:50 pm


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