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
 

 

How to use Branched IF statements in a jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 6:09 pm    Post subject: How to use Branched IF statements in a jcl
Reply with quote

Hi All


I have a requirement like this. I want to execute a step in a jcl based on the Return code of two different previous steps.

Eg:

IF PS020.RC = 0 THEN

IF PS010.RC = 100 or 200 THEN
execute a different job

ELSE
execute a different job

END-IF
END-IF

Basically the first IF will check for the Emptiness of a file using IDCAMS and the second IF wil check for the Return code a program executed in step PS010( Also i have to check with OR condition in second IF.. is it possible. )

Is this possble in a JCL ?

Please let me if you need any further information

Thanks
Karthik
Back to top
View user's profile Send private message

Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 25, 2009 6:17 pm    Post subject: Reply to: How to use Branched IF statements in a jcl
Reply with quote

Quote:

IF PS020.RC = 0 THEN

IF PS010.RC = 100 or 200 THEN
execute a different job

ELSE
execute a different job


Do you want to excecute different job or different step in the same job?
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 6:21 pm    Post subject: Reply to: How to use Branched IF statements in a jcl
Reply with quote

Ofcourse,, want to execute a different step which wil executes a program and a subsequent step which wil load a job in jobtrac..
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 25, 2009 6:27 pm    Post subject: Reply to: How to use Branched IF statements in a jcl
Reply with quote

you can use like this.

IF (PS010R.RC=0100 OR PS010R.RC=0200 OR PS010R.RC=0)

execute your step


ENDIF ......(no hyphen)

similarly you can use AND conditions.
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 6:42 pm    Post subject: Reply to: How to use Branched IF statements in a jcl
Reply with quote

Well... the above condition satisfies if either one of the two steps satisfies, but it doesnt suits to my requirement..

Guide me if the following Condition works or not.


IF (PS020.RC=0 AND (PS010.RC=100 OR PS010.RC=200)) THEN

do something

ENDIF

IF (PS020.RC=0 AND (PS010.RC=300 OR PS010.RC=400)) THEN

do something

ENDIF

Thanks
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon May 25, 2009 6:51 pm    Post subject:
Reply with quote

what is the problem in it?

you can use it similar to normal if conditions in cobol.

Your above conds will work.
Back to top
View user's profile Send private message
dkarthikreddy

New User


Joined: 14 Mar 2008
Posts: 28
Location: bangalore

PostPosted: Mon May 25, 2009 6:54 pm    Post subject: Reply to: How to use Branched IF statements in a jcl
Reply with quote

Fine.. I just need the confirmation whether i go can go ahead and use the above condition..Now i wil use it and test it..

Thanks a lot for your valuable reply

Karthik
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 Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Extracting Information from DD Statem... Charles Wolters All Other Mainframe Topics 7 Wed Apr 13, 2016 10:21 pm
No new posts Parsing JCL SET var=value statements prino CLIST & REXX 0 Sat Dec 26, 2015 4:41 am
No new posts DFSORT control statements in any order ? ronald masters DFSORT/ICETOOL 2 Tue Dec 15, 2015 11:22 pm
No new posts Any example of XML GENERATE nested st... marianambot COBOL Programming 6 Tue Sep 22, 2015 7:48 pm


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