View previous topic :: View next topic
|
Author |
Message |
trgdhilip
New User
Joined: 24 Dec 2007 Posts: 3 Location: chennai
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
|