CL/400 WITH RESTART OPTION

540 pts.
Tags:
CL/400
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

hi Roberto,
I prepared this program sketch for you, which I hope can help you.

<pre>
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
</pre>

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • RBDSILVA
    Dan my friend, Thanks for Your help. This problem was resolved and works perfect. Regards, Roberto from Brazil.
    540 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following