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

Error in COND statement in JCL


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

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Thu Nov 08, 2007 1:35 pm
Reply with quote

Hi all....

following is my requirement....
step 30 should execute when step 20 issues a Return code of 1 or 3... step 20 is the immediate preceding step of step 30...

i have tried following COND statement... it is giving me an error...

Code:

COND=((1,NE,STEP020),(3,NE,STEP020))



I also Tried following condition...

Code:

COND=((1,LT,STEP020),(3,GT,STEP020),(2,EQ,STEP020))

--Amol
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

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

Hi Amol try the following and please let me know whether ot works or not:
Code:


// IF (STEP20.RC EQ 1 OR STEP20.RC EQ 3) THEN
//STEP30 EXEC PGM=XXXX
// ENDIF



Please note the space between the delimitor and IF as well as ENDIF
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Thu Nov 08, 2007 2:38 pm
Reply with quote

Thnks Swapnadeep...
It is working fine now... but i wanted to know whether it is possible to these conditions in COND statement onle instead of IF...
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 08, 2007 2:48 pm
Reply with quote

Hi Amol,

Can you post here the error you got... Definitley it is possible thru COND.

Thanks,
Arun
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Nov 08, 2007 2:50 pm
Reply with quote

Hi Amol,

The COND parameter provided by you should work fine.

Code:

COND=((1,NE,STEP020),(3,NE,STEP020))
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Thu Nov 08, 2007 2:57 pm
Reply with quote

Swanadeep,

Quote:
COND=((1,NE,STEP020),(3,NE,STEP020))

Did you try this? Also, refer manual how above COND gets evaluated.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Nov 08, 2007 3:03 pm
Reply with quote

Murali please correct me if I am wrong in my understanding:

As far as I understood, the step30 is to execute only if step020 returns a code equal to 1 or 3.

Now in the above COND parameter, step030 is bypassed if 1 is not equal to the return code issued by step020 or if 3 is not equal to the return code issued by step030.
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Thu Nov 08, 2007 3:10 pm
Reply with quote

Swapnadeep,

As suggested, you should have gone thru manual for COND parm evaluation.

Quote:
COND=((1,NE,STEP020),(3,NE,STEP020))

When both the conds satisfy, the step is executed. In other words AND rule applies here.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Nov 08, 2007 3:25 pm
Reply with quote

Thank you Murali to point out the error in my understanding.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 08, 2007 3:27 pm
Reply with quote

happy conclusion to the cond saga....

&deity &bless IBM for introducing the "// IF" !!!
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Thu Nov 08, 2007 3:41 pm
Reply with quote

Code:
IBM for introducing the "// IF"

And withit OR.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Nov 08, 2007 4:48 pm
Reply with quote

Hi Amol,

Try this COND code .....

Code:

COND=((3,LT,STEP020),(0,EQ,STEP020),(2,EQ,STEP020))



Thanks,
Arun
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Fri Nov 09, 2007 8:38 am
Reply with quote

Arun,

Quote:
Try this COND code .....

One word - Good.
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 Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top