The keywords that are used to run the BATCHBACK command
are described.
- BATCHBACK JOB(jobname) FAILED
-
- FAILED
- Specifies that CICS® VR
backs out all updates that were made by the step that encountered
an abend during the latest execution of the specified jobname
regardless of whether it is a step or a procedure step.
The step that encountered the abend must have been the last step run
by the specified job. When FAILED is specified, CICS VR verifies that the last step run by the
specified job did encounter an abend. If the step did not encounter
an abend, a message is produced and batch backout does not continue.
However, if you want to backout the updates made by a step regardless
of if it encountered an abend or not, you can specify the
STEP/PROCSTEP
keyword.
- BATCHBACK JOB(jobname) STEP(stepname)
-
- STEP
- Specifies that CICS VR
backs out all updates that were made by the specified step, and all
subsequent steps,
regardless of whether they call a
procedure or not,
during the latest execution of the specified jobname.
It proceeds regardless of whether the steps encounter an abend or
not. For example, consider a scenario where a batch job named TESTJOB
ran the following four steps in the order shown:
- STEP1
- STEP2
- STEP3
- STEP4
None of these steps call a procedure. 
Executing
the following batch backout command causes CICS VR to remove all updates made by steps
STEP2, STEP3, and STEP4:
BATCHBACK JOB(TESTJOB) STEP(STEP2)

Assume that STEP2 calls a procedure PROCBA, that runs two
following steps in the order shown:
- PROCST1
- PROCST2
When you execute the following batch backout command, CICS VR removes all updates made
by the procedure steps PROCST1 and PROCST2 in step STEP2, step STEP3,
and step STEP4:
BATCHBACK JOB(TESTJOB) STEP(STEP2)

BATCHBACK JOB(jobname) STEP(stepname) PROCSTEP(procstepname) 
- STEP, PROCSTEP
- Specifies that CICS VR
backs out all updates that were made by the specified procedure step
in the specified step, and all subsequent steps, during the latest
execution of the specified jobname, regardless of whether the steps
encountered an abend.
- For example, consider a scenario where a batch job named TESTJOB
ran the following four steps in the order shown:
- STEP1
- STEP2
- STEP3
- STEP4
Step STEP1 and step STEP2 call procedure PROCBA. Procedure PROCBA
runs two following steps in the order shown: - PROCST1
- PROCST2
Executing the following batch backout command causes CICS VR to remove all updates made
by the procedure step PROCST2 called in step STEP2, and made by steps
STEP3 and STEP4. Procsteps in STEP1 and procstep PROCST1 in STEP2
are ignored: BATCHBACK JOB(TESTJOB) STEP(STEP2) PROCSTEP(PROCST2)

- BATCHBACK JOB(jobname)
- JOB
- Specifies that CICS VR
backs out all updates that were made by every step during the latest
execution of the specified jobname, regardless
of whether the steps encountered an abend.
- BATCHBACK JOB(jobname) JOBID(JES
job ID)
- JOBID
- When a JOBID is specified, only the steps of the specified JOB
name with a matching JES job ID is backed out.
JOBID is an optional keyword. JOBID is processed when the RCDS is
specified in the batch backout job, and also when the RCDS is not
available to the batch backout job.
- BATCHBACK JOB(jobname) SPHERENAME(spherename)
- SPHERENAME
- If SPHERENAME is specified, only the VSAM spheres listed are backed
out. SPHERENAME is an optional keyword. Any number of spheres can
be specified.
For more information, see BATCHBACK: Remove updates to VSAM spheres.
The following example removes all updates that were made by the
last step run in job TESTJOB, if it encountered an abend.
Figure 1. Example of executing
the CICS VR batch backout utility
//BTCHBACK JOB ACCOUNTING INFORMATION,REGION=4M
//BA EXEC PGM=DWWBACK
//STEPLIB DD DSN=DWW.SDWWLOAD,DISP=SHR
// DD DSN=DWW.SDWWLENU,DISP=SHR
//DWWLOAD DD DISP=SHR,DSN=DWW.SDWWLOAD
// DD DISP=SHR,DSN=DWW.SDWWLENU
// DD DISP=SHR,DSN=exits load library name
//DWWMSG DD SYSOUT=*
//DWWPRINT DD SYSOUT=*
//DWWCON1 DD DSN=DWW.DWWCON1.GRPPROD,DISP=SHR
//DWWCON2 DD DSN=DWW.DWWCON2.GRPPROD,DISP=SHR
//DWWCON3 DD DSN=DWW.DWWCON3.GRPPROD,DISP=SHR
//DWWIN DD *
BATCHBACK JOB(TESTJOB) FAILED
/*
//
Note: Only one BATCHBACK command can be entered per job step that
starts the DWWBACK program.