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

To stop execution of a job without abending


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

New User


Joined: 25 Jul 2007
Posts: 3
Location: ohio

PostPosted: Mon Oct 29, 2007 11:59 pm
Reply with quote

Hi

Am trying to wrapup a job based on a condition of a previous step.I do not want to abend the job with any userabends but want a clean return code.

Here is what I want:

\\STEP A
\\STEP B
\\STEP C
\\STEP D

All I want to do is to wrap up the job if suppose STEP A return me macc 4
and do not want to execute step b,c,d.
STEP B ,C and D already have COND parameters so its not very good to have more conditions.

Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all.
I have tried STOPEXEC but it shoots a user abend U0076 which I do not want.

Appreciate your help on this.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Oct 30, 2007 12:01 am
Reply with quote

sunnyma wrote:
Hi

Am trying to wrapup a job based on a condition of a previous step.I do not want to abend the job with any userabends but want a clean return code.

Here is what I want:

\\STEP A
\\STEP B
\\STEP C
\\STEP D

All I want to do is to wrap up the job if suppose STEP A return me macc 4
and do not want to execute step b,c,d.
STEP B ,C and D already have COND parameters so its not very good to have more conditions.

Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all.
I have tried STOPEXEC but it shoots a user abend U0076 which I do not want.

Appreciate your help on this.


Look at the IF statement in the JCL Manual.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Oct 30, 2007 12:04 am
Reply with quote

sunnyma wrote:
Can I have a step added btwn STEP A and B so that it checks for A's return code and skip the rest of the jcl and dont execute them at all.


No. Based on your limitations, I'd suggest moving steps B,C, and D to another job. Then, you can run/not-run that job based on the return-code of STEPA.
Back to top
View user's profile Send private message
sunnyma

New User


Joined: 25 Jul 2007
Posts: 3
Location: ohio

PostPosted: Tue Oct 30, 2007 12:21 am
Reply with quote

Thanks Kevin and Craq ,but I was looking for a solution within the same jcls as thats also one of my limitations,I would like to wrap up this job only without a user abend code.
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: Tue Oct 30, 2007 12:39 am
Reply with quote

Hello,

Quote:
STEP B ,C and D already have COND parameters so its not very good to have more conditions.
Who made this "rule"? It is quite common for multiple condition codes to be tested.

The way to
Quote:
skip the rest of the jcl
is to test condition code(s) and bypass step(s) accordingly.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 30, 2007 12:45 am
Reply with quote

Quote:
so its not very good to have more conditions.


What' s wrong in having all the conditions You need..

I agree that the cond parameter is not friendly,
but why not use the "// IF" constructs,
they are more friendly and easy to understand
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Oct 30, 2007 12:47 am
Reply with quote

sunnyma wrote:
Thanks Kevin and Craq ,but I was looking for a solution within the same jcls as thats also one of my limitations,I would like to wrap up this job only without a user abend code.

I'm not sure what you mean by user abend code, a nonzero return code is not a user abend. You add an if statement between steps A and B just to skip the rest of the depending on the RC of step A.
Back to top
View user's profile Send private message
sunnyma

New User


Joined: 25 Jul 2007
Posts: 3
Location: ohio

PostPosted: Tue Oct 30, 2007 12:54 am
Reply with quote

Craq your suggestions worked for me thanks a lot
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Oct 30, 2007 12:55 am
Reply with quote

sunnyma wrote:
Craq your suggestions worked for me thanks a lot

Your welcome
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Oct 30, 2007 1:12 am
Reply with quote

Did I miss something? icon_confused.gif

I thought the original post said that there should be no more condition code checks added?
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Oct 30, 2007 7:03 am
Reply with quote

Hi sunnyma,

You could also code a COND in the JOB stmt. When any step issues a RC that satisfies the JOB stmt COND the JOB execution terminates, by-passing the remaining steps.
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 Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Parallel Sysplex - subprogram execution CICS 7
No new posts Prod parallel execution on mainframe ... CICS 1
This topic is locked: you cannot edit posts or make replies. JCL execution fail COBOL program COBOL Programming 5
No new posts MFSUTIL execution unsuccessful - DFS1... IMS DB/DC 2
Search our Forums:

Back to Top