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

Condition Code Help


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

New User


Joined: 27 May 2005
Posts: 4

PostPosted: Fri May 27, 2005 10:46 pm
Reply with quote

I have to implement a JCL driven email using BATCHTMP.But this is the 5th step in the Job and i need execute this step on failure on any step, Unabel to set it up using COND=XXXX steps. PLease help
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri May 27, 2005 10:51 pm
Reply with quote

COND=EVEN should make it work.
Back to top
View user's profile Send private message
abhi2879

New User


Joined: 27 May 2005
Posts: 4

PostPosted: Sat May 28, 2005 12:35 am
Reply with quote

My criteria is if any step fails then only the BATCHTMP step shud execute. COND=EVEN will execute in any COndition
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat May 28, 2005 1:17 am
Reply with quote

Guess it should be COND=ONLY then.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat May 28, 2005 1:51 am
Reply with quote

I think that if it was up to me, I'd rather use IF/THEN statements so I could handle both step abends and steps with non-acceptable return codes:
Code:

// IF (ABEND=TRUE | RC > 4) THEN
//BATCHTMP EXEC PGM=BATCHTMP
//...
// ENDIF
Back to top
View user's profile Send private message
abhi2879

New User


Joined: 27 May 2005
Posts: 4

PostPosted: Sat May 28, 2005 3:54 am
Reply with quote

My constraints are

1. If STEP010 fails STEP020 will not be executed, but STEP030 which is the BATCHTMP step should be executed to send the mail.
2. If all the steps are with RC=0, the BATCHTMP Step should not be executed.

Is there any cond where in if a step fails, the successive step instead of checking the RC and not executing ,it will check the RC and transfer the JCL execution control to the particular step which has the BATCHTMP step.

I know i am asking for more
Back to top
View user's profile Send private message
jkbytes

Active User


Joined: 19 Feb 2005
Posts: 139
Location: South Africa

PostPosted: Sat May 28, 2005 9:55 am
Reply with quote

Hi,

You can check for the return code of STEP010 IN STEP020 using a condition or you can also use an if statement as superk told for STEP020, and have a COND=ONLY IN STEP030.

I guess this would work fine for you.
Back to top
View user's profile Send private message
Suresh Antony
Warnings : 1

New User


Joined: 27 May 2005
Posts: 3
Location: Bangalore

PostPosted: Sat May 28, 2005 12:24 pm
Reply with quote

Hi Abhi,
Your question is that u need to execute 5th step(BATCHTMP) in the job only if any of the above steps fails...

If so... u can use the condition in the 5ht step as COND=(0,LE).. i think it should work

Thanks,
Suresh Antony
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 28, 2005 9:31 pm
Reply with quote

Hi Ahbi,

If you want an appropriate ans to your ques you have to invest the time to precicely define the problem.

Show us the JCL. Tell us exactly what "fails" means - a certain RC (GT 0;4, 12, and 16?); an abend; both? Multiple examples of what the solution should accomplish can be of help.

Expecting people supply solutions based on inadequate info and then rejecting them because they don't address a scenerio you neglected to mention is rude, because it expects them to spend more time on the problem than you do.
Back to top
View user's profile Send private message
abhi2879

New User


Joined: 27 May 2005
Posts: 4

PostPosted: Sat May 28, 2005 9:50 pm
Reply with quote

I am sorry if my post was rude and was no detailed.
My condition is if the RC of any step is greater than Zero, the jcl should execute only the last step which is the BATCHTMP step.

Sorry again :!:
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun May 29, 2005 9:19 am
Reply with quote

What do you want to do if any step abends?
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 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
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top