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

COND Parameter doubt


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

New User


Joined: 22 Feb 2007
Posts: 6
Location: INDIA

PostPosted: Wed Nov 21, 2007 1:30 pm
Reply with quote

I am having a doubt regarding COND PARAMETER.
Following are the details of the JCL with CONDitions applied to the STEPS of the JCL :
STEPNAME ------ RC
STEP005 ------ NO COND PARAMETER HANDLE
STEP010 ------ COND=(0,NE)
STEP020 ------ COND=(4,LT,STEP010)
STEP030 ------ COND=((4,LT,STEP010),(0,NE,STEP020))
STEP040 ------ ?
NOW STEP040 should run to all conditions where-if the previous steps fails with RC = 00 / 04, this STEP should not FLUSH. & with any other RC return STEP040 should FLUSH.
I have coded
//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030)
This fulfills the requirement!
But I had a doubt regarding COND parameter, that, as per my knowledge for any STEP which includes COND parameter like (code, operator{,previous stepname}), it means that if the condition goes false for the previous STEP then only the subsequent STEP should run.
So as per my requirement STEP040 should run with following CODE :
//STEP040 EXEC PGM=XXXX,COND=(4,GT)
But the requirement is not getting done with the above CODE.
Can you please help me out regarding this and correct me if I am wrong regarding COND parameter concept?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Nov 21, 2007 2:27 pm
Reply with quote

Poulomi,

Quote:
steps fails with RC = 00

Are you sure?

Is it a shop specific setup? I assume 00/04 never mean job/step failure. Please post your requirement clearly and remember we cant read your mind.
Back to top
View user's profile Send private message
poulomi

New User


Joined: 22 Feb 2007
Posts: 6
Location: INDIA

PostPosted: Wed Nov 21, 2007 3:52 pm
Reply with quote

Murali,

Sorry for wrong explaination stated by me.

Actually I wanted to say that :

STEP040 should run in all cases where either of the steps viz. STEP005, STEP010, STEP020, STEP030 returning RC= 00/04.

& STEP040 should FLUSH in case either of the stpes viz. STEP005, STEP010, STEP020, STEP030 returning RC > 04.

For the above requirement I thought that code

//STEP040 EXEC PGM=XXXX,COND=(4,GT)

should ideally work.

But I got the requirement done with

//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030) .

I just wanted to clarify my knowlenge regarding COND PARAMETER.

Is it that?

Any STEP which includes COND parameter like (code, operator), it means that if the condition goes false for the previous STEP then only the subsequent STEP should run.

((If the above statement is true then I should get the requirement done by
//STEP040 EXEC PGM=XXXX,COND=(4,GT).))

Or am I going wrong with the concept as here its working on the other way i.e.

Any STEP which includes COND parameter like (code, operator{,previous stepname}), it means that if the condition goes true for the previous STEP then only the subsequent STEP should run.


Hope I am clear with my doubt.

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 21, 2007 3:55 pm
Reply with quote

why not use the "// IF" jcl statement
it will simplify and make happier ( from an IT point of view ) everybody' s life
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Nov 22, 2007 6:23 am
Reply with quote

poulomi wrote:
//STEP040 EXEC PGM=XXXX,COND=(4,GT)

should ideally work.



It shouldn't work. Because this means if 4 is GREATER than any previous return code, then don't run STEP040.

So if STEP030 ends with 00, 01, 02, 03 then STEP040 doesn't run.

Hope it clears your doubt.
Back to top
View user's profile Send private message
poulomi

New User


Joined: 22 Feb 2007
Posts: 6
Location: INDIA

PostPosted: Thu Nov 22, 2007 10:33 am
Reply with quote

Thank you.

It helped me out.
Back to top
View user's profile Send private message
poulomi

New User


Joined: 22 Feb 2007
Posts: 6
Location: INDIA

PostPosted: Thu Nov 22, 2007 12:30 pm
Reply with quote

Sorry for the last post!

Wanderer Stated :-

Quote:
//STEP040 EXEC PGM=XXXX,COND=(4,GT)

It shouldn't work. Because this means if 4 is GREATER than any previous return code, then don't run STEP040.

So if STEP030 ends with 00, 01, 02, 03 then STEP040 doesn't run.


As per your STATEMENT If in previous steps RC > 4 ,STEP040 should not run.
That implies if previous STEPs returns 00, 01, 02, 03, 04 then STEP040 should run.

This is the CONDition which is satisfies my requirement in the JCL!

But actually its working in the reverse case!
//STEP040 EXEC PGM=XXXX,COND=(4,LT,STEP030)


Ur help is still needed!
Regards,
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Nov 22, 2007 1:39 pm
Reply with quote

poulomi,

Quote:


wanderer stated

//STEP040 EXEC PGM=XXXX,COND=(4,GT)

It shouldn't work. Because this means if 4 is GREATER than any previous return code, then don't run STEP040.



This is correct

Quote:
So if STEP030 ends with 00, 01, 02, 03 then STEP040 doesn't run.


This is wrong.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Nov 22, 2007 1:44 pm
Reply with quote

Poulomi,

COND parameter has been discussed so many times in this forum. Do search for examples.

As suggested use ??IF .Also Check this similar topic.

http://ibmmainframes.com/viewtopic.php?t=25666
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Fri Nov 23, 2007 7:12 am
Reply with quote

poulomi wrote:

As per your STATEMENT If in previous steps RC > 4 ,STEP040 should not run.


That is opposite of what I said.

I said, if 4 > RC of previous steps (or previous steps RC <= 4), then don't run step040.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
Search our Forums:

Back to Top