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
 

 

Job should abend if a step returns RC=0012
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 7:43 am    Post subject: Job should abend if a step returns RC=0012
Reply with quote

Suppose i have a job step JS010 & JS020. Now i want to place a job step after JS010 which will check the return code of JS010 & the job will abend if RC=0012. HOw can this be done? I checked the forum but couldnt find anything
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Feb 04, 2009 7:53 am    Post subject:
Reply with quote

The answer is in the JCL Manual. See the IF/THEN/ELSE/ENDIF construct.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Feb 04, 2009 7:56 am    Post subject:
Reply with quote

Hi,

why do you need to abend the job ?

If you really need to abend a job, you can run a program such as SAS to generate an abend code or execute a program that does not exist, this will return an 806 abend code.

Gerry
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 8:02 am    Post subject: Hi
Reply with quote

What i want is that the job should abend if JS010.RC=12 else it should proceed with the execution of the next 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: Wed Feb 04, 2009 8:25 am    Post subject:
Reply with quote

Hello,

Why do you want an abend - there is already an rc=12 that can be used to conditionally not execute the next step.

Most organizations do not want unnecessary abends. Conditional execution is usually preferred.

If only an abend will do, change the module that issues the rc=12 and have it abend instead.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 9:08 am    Post subject: hi
Reply with quote

Actually, what happens is that we get an RC=12 in some steps but still the job goes on to execute the next step and it might have a RC=0.

So if we have 4 steps.
JS010
JS020
JS030
JS040

I want to put a condition after JS020 that the job should abend if JS020.RC=12. Similarly i want to put a condition after JS030 that the job should abend if JS030.RC=12. Because otheriwse suppose i get a RC=12 in JS020 then still the job will go ahead and execute the rest of the steps.

I am thinking something like the below.
Code:

//JS010 EXEC.....
//JS020 EXEC......
//JS021 IF (JS020.RC = 12) THEN
 ABEND HERE
//ELSE
 CONTINUE
//JS030 EXEC.......
//JS031 IF (JS020.RC = 12) THEN
 ABEND HERE
//ELSE
 CONTINUE
//JS040 EXEC.......
//
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: Wed Feb 04, 2009 9:18 am    Post subject: Reply to: Job should abend if a step returns RC=0012
Reply with quote

There are many topics in these forums that explain how to code a COBOL program to abend by using a call to ILBOABN0.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 9:21 am    Post subject: Hi Kevin
Reply with quote

I am not looking for a COBOL program here. I just want something in my existing JCL
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Feb 04, 2009 9:21 am    Post subject:
Reply with quote

Hi,

the only reason steps continue to process is because you have incorrectly tested the return codes or the lack of testing.



Gerry
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 9:33 am    Post subject: Hi
Reply with quote

I think the system is setup this way......please can someone give some solution as to how this is to be done
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: Wed Feb 04, 2009 9:48 am    Post subject:
Reply with quote

Hello,

Quote:
what happens is that we get an RC=12 in some steps but still the job goes on to execute the next step

Quote:
I want to put a condition after JS020 that the job should abend if JS020.RC=12. Similarly i want to put a condition after JS030 that the job should abend if JS030.RC=12. Because otheriwse suppose i get a RC=12 in JS020 then still the job will go ahead and execute the rest of the steps.

If you properly check the rc, you will be able to prevent this. . .
Quote:
please can someone give some solution as to how this is to be done
code COND=(12,EQ) the EXEC for JS020, JS030, and JS040.

At the top of the page is a link to "IBM Manuals" whick includes the JCL Reference. There are examples of cond= in the manual. If you find something that is not clear, post what you found and your queston about it. Someone will be able to clarify.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 10:24 am    Post subject: hi
Reply with quote

Code:

JS010    ** R0000 **
JS020    ** R0000 **
JS030    ** R0012 **
JS035    ** R0012 **
JS040    ** R0000 **
JS050    ** R0000 **
JS060    ** R0000 **


I have the above information of the return codes from the actual job. PS030 & PS035 are FTP steps & the RC of an FTP step is set to 12 if there is an any issue while FTPing, as can be seen that still the continuing jobsteps still ran. So restating that i just want the job to abend after JS030 if the JS030.RC=12 similarly for JS035.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Feb 04, 2009 10:40 am    Post subject:
Reply with quote

Hi,

it helps if you explain what you are trying to do, so are you saying your issue arises only when restarting the job ?

If you only want to run the one step, then just code this on your jobcard



Code:
//         RESTART=JS030.XXXX,COND=(0,EQ)



Gerry
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 10:44 am    Post subject: hi gcicchet
Reply with quote

No you got it wrong.

Actually the job is having steps JS030 & JS035 which are the FTP steps. Now FTP steps are such that if there is an issue while FTP'ing a dataset then the return code is set to 12 but the job goes on to execute the next steps & does not abend. I infact want the job to abend if it finds a RC=12 at JS030 & JS035.

I hope there is no confusion now. Thanks
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Feb 04, 2009 10:47 am    Post subject:
Reply with quote

Vikram,

You have probably not tried what d.sch. has suggested. The answer is there with the COND parameter which you need to code for each step from JS020. Have you tried that solution?

Probably your meaning for 'abend' is that you want remaining jobsteps to be 'flushed' in case a step returns RC12. Is this correct?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Feb 04, 2009 10:54 am    Post subject:
Reply with quote

Hi,

my apologies, I read your restating as restarting (time for glasses). icon_redface.gif

Are you not concerned if JS010 & JS020 return a cond greater than 0 ?


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Wed Feb 04, 2009 10:57 am    Post subject:
Reply with quote

Vikram,

As repeatedly suggested in the above thread, it IS possible to prevent the execution of subsequent steps by the proper usage of the COND parameter.
Back to top
View user's profile Send private message
vikramyadav

New User


Joined: 28 May 2005
Posts: 41
Location: Gurgaon

PostPosted: Wed Feb 04, 2009 11:01 am    Post subject: Hi gcicchet
Reply with quote

Hi gcicchet

I am only concerned with the RC of JS030 & JS035 as only these are the FTP steps.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Wed Feb 04, 2009 11:05 am    Post subject:
Reply with quote

Why not try out the solution already posted here by Dick?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Feb 04, 2009 11:07 am    Post subject:
Reply with quote

Hi,

I was looking for a simpler solution, ie. if you code
Code:
//   COND=(0,LT)
on the jobcard, as soon as a step has a RC greater than 0, subsequent steps will flush.


Gerry
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm


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