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
 

 

Error in COND statement in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Error in COND statement in JCL
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    Post subject:
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    Post subject:
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: 2238
Location: @my desk

PostPosted: Thu Nov 08, 2007 2:48 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 2:57 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 3:10 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Thu Nov 08, 2007 3:27 pm    Post subject: Reply to: COND statement in JCL
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: 1439
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 3:41 pm    Post subject:
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: 2238
Location: @my desk

PostPosted: Thu Nov 08, 2007 4:48 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Nov 09, 2007 8:38 am    Post subject:
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    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
No new posts IDC2902I Error tzeche ABENDS & Debugging 1 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


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