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
 

 

Getting out of loop from a job.

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

New User


Joined: 24 Dec 2007
Posts: 3
Location: chennai

PostPosted: Wed Jan 09, 2008 7:56 pm    Post subject:
Reply with quote

hi all,
I have scenario like this.
If step1 return code is 0 complete the job successfully. If it is not equal to 0 means run remaining steps(as much as 100 steps) and complete the job successfully. Can we implement the same without using IF-ELSE-ENDIF loop. (Instead of putting remaining 100 steps under STEP1.RC=4, can we check STEP1.RC=0, run pgm-q and complete successfully)

IF STEP1.RC=0
RUN PGM-Q
COMPLETE THE JOB SUCCESSFULLY. ( After that control should go out and PGM-A,PGM-B.PGM-C... etc shouldnt be executed )
END-IF

Run PGM-A
Run PGM-B
Run PGM-C
-
-
-
-
RUN PGM-Z.

Please give me a solution.
Back to top
View user's profile Send private message

stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Jan 09, 2008 8:19 pm    Post subject:
Reply with quote

Split it into 2 jobs then use your scheduler.

Why are you not using the IF-ELSE-ENDIF construct? Homework or something?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jan 09, 2008 8:22 pm    Post subject:
Reply with quote

trgdhilip wrote:
hi all,
I have scenario like this.
If step1 return code is 0 complete the job successfully. If it is not equal to 0 means run remaining steps(as much as 100 steps) and complete the job successfully. Can we implement the same without using IF-ELSE-ENDIF loop. (Instead of putting remaining 100 steps under STEP1.RC=4, can we check STEP1.RC=0, run pgm-q and complete successfully)

IF STEP1.RC=0
RUN PGM-Q
COMPLETE THE JOB SUCCESSFULLY. ( After that control should go out and PGM-A,PGM-B.PGM-C... etc shouldnt be executed )
END-IF

Run PGM-A
Run PGM-B
Run PGM-C
-
-
-
-
RUN PGM-Z.

Please give me a solution.


IF..ELSE..ENDIF is NOT a loop!

You complete the job successfully by skipping the remaining steps.
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 save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am
No new posts print out the correct info in LOOP? jackzhang75 CLIST & REXX 7 Wed Dec 23, 2015 10:39 pm
No new posts Using different values for Skeleton d... venksiv CLIST & REXX 8 Thu Sep 03, 2015 5:28 pm
No new posts Issue with Do Loop. santosh_g CLIST & REXX 5 Tue May 12, 2015 9:24 am
No new posts A cursor within a multi-fetch cursor ... Rohit Umarjikar DB2 1 Thu Mar 06, 2014 9:43 am


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