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

Need to set Return code = 0 for a JCL statement


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

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 1:37 pm
Reply with quote

Hi

I have a DROP VIEW step in JOB and in case the view doesnot exists my JCL gives a return code of 8. I need that the return code of my JCL should always be 0.

Can I set it in any way,,, icon_idea.gif

Thanks
Kushal
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Oct 22, 2012 1:45 pm
Reply with quote

Hi Kushal,

This Query Belongs to JCL forum and not Cobol

Quote:
I need that the return code of my JCL should always be 0.


Do you want MAXCC or LASTCC to be SET as 0??
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Oct 22, 2012 1:53 pm
Reply with quote

Hi Kushal,

If you're with z/OS Version 1 Release 13, please review JOBRC Parameter of JOB statement.

And, your scheduling package might have a functionality to do this.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 22, 2012 1:55 pm
Reply with quote

Quote:
Do you want MAXCC or LASTCC to be SET as 0??


MAXCC and LASTCC are IDCAMS terms not JCL' s

depending on the zOS level the following terms apply

JOBRC and MAXRC LASTRC

Quote:
| JOBRC= {MAXRC}
| {LASTRC}
| {(STEP,stepname[.procstepname]}
|


where JOBRC will be the return code presented to JES

see here for the whole shebang

z/OS V1R13.0 MVS JCL User's Guide
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea2b570/CCONTENTS?SHELF=all13be9&DN=SA22-7598-07&DT=20110610095749
z/OS V1R13.0 MVS JCL Reference
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea2b6b1/CCONTENTS?SHELF=all13be9&DN=SA22-7597-16&DT=20120814180937


AND WHAT HAS THE QUESTION TO DO WITH COBOL ?
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 2:06 pm
Reply with quote

I have the JCL step where I am getting RC 8
//DB2SQDV EXEC DB2SQL
//DB2SAUTH DD *
PI000004
/*
//SYSIN DD *
DROP VIEW PI000004.PI@PPDI;

so to achive overall RC 0 I should code in the jobcard
| JOBRC= {8}
| {0}
| {DB2SAUTH}

Is it ?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Oct 22, 2012 2:08 pm
Reply with quote

Please try and let us know the result.
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 2:40 pm
Reply with quote

one help how do we use JOBRC ?
KUSDVIEW JOB (D03,07PI),'DROP VIEW TEST',
MSGCLASS=D,NOTIFY=Z099,GROUP=Z099,
JOBRC(8,0,DB2SQDV)

This is definately wrong as I am getting following errors on JJ

LABEL SV MSG.NO. ERROR MESSAGE
-------- -- -------- -------------------------------------------------
.JAAA 8 DSS6160E - "(" IS AN INVALID DELIMITER AS USED
.JAAA 8 DSS1090E - INCORRECT POSITIONAL PARAMETER - "JOBRC "
.JAAA 8 DSS1090E - INCORRECT POSITIONAL PARAMETER - "8 "
.JAAA 8 DSS1090E - INCORRECT POSITIONAL PARAMETER - "0 "
.JAAA 8 DSS6070E - UNEQUAL NUMBER OF RIGHT PARENTHESES
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 22, 2012 2:43 pm
Reply with quote

Forget JJ. Toss a little test JCL into the system. Consult the current JCL manual. Look at any error messages.
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 2:59 pm
Reply with quote

Tried running the JCL by appending JOBRC(8,0,DB2SQDV) gettin error JCL ERROR INCORRECT POSITIONAL PARAMETER - "JOBRC "




Checked the system its :-- JES: JES2 z/OS1.12
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Oct 22, 2012 3:06 pm
Reply with quote

kushal Bothra wrote:
Checked the system its :-- JES: JES2 z/OS1.12

In that case, you cannot modify the completion code of the job; it will be the highest completion code of any step. JOBRC is only available in z/OS 1.13.
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 3:09 pm
Reply with quote

Any other option to change RC of a particular step from 8 to 0 or if any step in my JCL is ending with maxcc 8 can by any option my JCL end with RC 0 .. ? icon_confused.gif
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 3:20 pm
Reply with quote

Quote:


What can be the resolution ???? icon_confused.gif icon_eek.gif icon_sad.gif icon_mad.gif icon_rolleyes.gif

Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 22, 2012 3:37 pm
Reply with quote

Quote:
What can be the resolution ????

You will have to learn to live without a JCL solution . AMEN

if You are using a scheduler speak to Your support in order
to consider a RC 8 for that step a success and not a failure.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Oct 22, 2012 4:15 pm
Reply with quote

Quote:
Any other option to change RC of a particular step from 8 to 0 or if any step in my JCL is ending with maxcc 8 can by any option my JCL end with RC 0 .. ?
No, you have no other option -- follow the suggestions you have already been given by enrico and akatsukami.

You may "need" the return code to be zero, but it will not be -- PERIOD. Furthermore, your terminology needs to be improved: MAXCC is a term extremely specific to one utlity (IDCAMS) and only to that utility. A job has a return code, not MAXCC, for each step.
Back to top
View user's profile Send private message
kushal Bothra

New User


Joined: 16 Feb 2011
Posts: 38
Location: Gurgoan

PostPosted: Mon Oct 22, 2012 4:22 pm
Reply with quote

Thanks Robert Comments kept in mind
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Oct 22, 2012 5:46 pm
Reply with quote

One solution is to alter the program that is running your SQL statement. If I recall correctly, IBM supplies the source code for DSNTEP2/4, DSNTIAUL and DSNTIAD. You can modify it if you wish.

Another option is to write your own simple DSNREXX program to issue the DROP. It is not as difficult as you might think; the Rexx program can read the DROP from the SYSIN and pass it as a string to the EXECUTE IMMEDIATE SQL statement. You are then free to handle the SQLCODE as you wish.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
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
Search our Forums:

Back to Top