Restart the proc

 there are 4 step in proc in step 3 file is corrupted .so i want to use new dataset from jcl for 4 step and want to dummy out step 3 and how can you achieve this and from which step you will restart the job

To handle this scenario, you need to:

  1. Dummy out step 3 (since it uses corrupted file)

  2. Provide new dataset for step 4 from JCL

  3. Restart from step 3 (but skip it) and continue with step 4

Solution:

Method 1: Using COND Parameter and Dataset Override

In your Calling JCL:

jcl
//JOBNAME  JOB ...,RESTART=STEP3
//JCL      EXEC PROC=MYPROC
//PROC.STEP3.COND=(0,GT)              ← Dummy out step 3
//PROC.STEP4.DDNAME DSN=NEW.DATASET.NAME, ← New dataset for step 4
//             DISP=SHR

Method 2: Using Symbolic Parameters in PROC

If PROC has symbolic parameters:

jcl
//JOBNAME  JOB ...,RESTART=STEP3
//JCL      EXEC PROC=MYPROC,
//         STEP3FLG='(0,GT)',         ← Skip step 3
//         NEWDSN='NEW.DATASET.NAME'  ← New dataset for step 4

Restart Strategy:

You should restart from STEP3: ← This is the key point

jcl
//JOBNAME  JOB ...,RESTART=STEP3

Why restart from STEP3?

  • Steps 1 and 2 have already completed successfully

  • Step 3 needs to be bypassed (but the restart mechanism needs to process it)

  • Step 4 will use the new dataset

Complete Example:

Assuming this PROC structure:

jcl
//MYPROC PROC
//STEP1    EXEC PGM=PGM1
//STEP2    EXEC PGM=PGM2
//STEP3    EXEC PGM=PGM3
//         DD DSN=CORRUPTED.FILE,DISP=SHR
//STEP4    EXEC PGM=PGM4
//         DD DSN=ORIGINAL.FILE,DISP=SHR

Your JCL with restart:

jcl
//MYJOB    JOB (123),'PROD JOB',CLASS=A,
//         MSGCLASS=H,RESTART=STEP3    ← RESTART FROM STEP3
//JCL      EXEC PROC=MYPROC
//PROC.STEP3.COND=(0,GT)              ← SKIP STEP3
//PROC.STEP4.DD DSN=NEW.UNCORRUPTED.FILE, ← NEW DATASET FOR STEP4
//             DISP=SHR

Step-by-Step Execution:

  1. Job restarts from STEP3 (due to 

Comments

Popular posts from this blog

files and db2 abends&cics

jcl

cics interview question