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

Getting out of loop from a job.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts REXX - Dataset checking in a do forev... CLIST & REXX 6
No new posts Need to read duplicate rows from tabl... DB2 3
This topic is locked: you cannot edit posts or make replies. Cobol db2 program going in loop COBOL Programming 4
No new posts Need to loop & extract from varia... CLIST & REXX 2
Search our Forums:

Back to Top