CL/400 WITH RESTART OPTION
305 pts.
0
Q:
CL/400 WITH RESTART OPTION
Hi friends, How can I make a CL/400 with this situation, a CL/400 receive a parameter like ('00010') identifying the first process. If the first process ends with error I can start again initiating by ('00020') or ('00030') or ('00040') ?

This parameter inform what process start, exemple:

[00010]

CALL LIB/PROG1 .............. ..............

[00020]

 CALL LIB/PROG2 .............. ..............

[00030] CALL LIB/PROG3 .............. ..............

[00040] CALL LIB/PROG4 .............. ..............

 

 How can I resolve this situation ? Thanks, Roberto

ASKED: Aug 19 2009  4:50 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
245 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
hi Roberto,
I prepared this program sketch for you, which I hope can help you.


01.00 PGM PARM(&STARTPOINT)
02.00
03.00 DCL VAR(&STARTPOINT) TYPE(*CHAR) LEN(5)
04.00 DCL VAR(&JOBT) TYPE(*CHAR) LEN(1)
05.00
06.00 /**********************************************************/
07.00 /* PROCES CONTROL */
08.00 /**********************************************************/
09.00 /* Check for interactive or batch ('0'=batch, '1'=interactive) */
10.00 RTVJOBA TYPE(&JOBT)
11.00
12.00 SUBMIT: IF COND(&JOBT *EQ '1') THEN(DO)
13.00 START: SBMJOB CMD(CALL PGM(lib/thispgm) PARM('00010')) JOBD(lib/jobd)
14.00 GOTO CMDLBL(ENDPGM)
15.00 ENDDO
16.00
17.00 STEPTOGOTO: SELECT
18.00 WHEN COND(&STARTPOINT = '00010') THEN(GOTO CMDLBL(STEP00010))
19.00 WHEN COND(&STARTPOINT = '00020') THEN(GOTO CMDLBL(STEP00020))
20.00 WHEN COND(&STARTPOINT = '00030') THEN(GOTO CMDLBL(STEP00030))
21.00 .expand with more startpoints..
22.00 .
23.00 OTHERWISE
24.00 .send errmsg
25.00 GOTO CMDLBL(ENDPGM)
26.00 ENDSELECT
27.00
28.00 /**********************************************************/
29.00 /* PROGRAM CALLS */
30.00 /**********************************************************/
31.00 STEP00010: CALL PGM(prog1)
32.00 MONMSG MSGID(CPF0000) EXEC(DO) /* on error */
33.00 SBMJOB CMD(CALL PGM(thispgm) PARM('00020'))
34.00 GOTO CMDLBL(ENDPGM)
35.00 ENDDO
36.00
37.00 STEP00020: CALL PGM(prog2)
38.00 MONMSG MSGID(CPF0000) EXEC(DO)
39.00 SBMJOB CMD(CALL PGM(thispgm) PARM('00030'))
40.00 GOTO CMDLBL(ENDPGM)
41.00 ENDDO
42.00 .
43.00 .
44.00 .
45.00
46.00 ENDPGM: ENDPGM


If an error occurs during a jobstep (STEPnnnnn) in 'thispgm' , 'thispgm' will submit itself with the parameter for next jobstep, to the jobqueue specified in your 'jobd'

If you are not at a release that supports the SELECT-structure, you must rewrite this part using IF-structures.

happy coding..
Dan
Last Answered: Aug 19 2009  6:55 AM GMT by DanTheDane   245 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

RBDSILVA   305 pts.  |   Aug 20 2009  4:42AM GMT

Dan my friend, Thanks for Your help.

This problem was resolved and works perfect.

Regards,
Roberto from Brazil.

 
0