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
 

 

To stop execution of a job without abending

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To stop execution of a job without abending
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    Post subject: Re: To stop execution of a job without abending
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

Moderator Team Head


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

PostPosted: Tue Oct 30, 2007 12:04 am    Post subject: Re: To stop execution of a job without abending
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    Post subject:
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

Site Director


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

PostPosted: Tue Oct 30, 2007 12:39 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue Oct 30, 2007 12:45 am    Post subject: Reply to: To stop execution of a job without abending
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Oct 30, 2007 1:12 am    Post subject: Reply to: To stop execution of a job without abending
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts output DDname JESMSGLG job during exe... italo_pm TSO/ISPF 16 Tue Jun 21, 2016 11:13 am
No new posts Can a DB2 insert trigger execution of... TS70363 DB2 6 Tue Nov 24, 2015 10:44 pm
No new posts Stop Process when file is empty Roland Brosio DFSORT/ICETOOL 4 Thu Jun 25, 2015 1:20 pm
No new posts Fetch execution time of a job using R... ashirwad CLIST & REXX 3 Wed Apr 08, 2015 6:32 pm


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