After organizing a Batch Processor (BP) script into several application areas using .SYSTEM statements, a Batch Processor batch job is submitted with .RESTART SYSTEM cards that only process certain application areas.
The job fails in one area. After correcting the problem, how do I restart the job so that it restarts at the correct point, and only processes the application areas I originally coded?
Ensure .SYNC statements are coded throughout your BP script at appropriate points to cause the work to be committed and create appropriate entries in the DB2 products Restart table.
To submit the job and have it restart in the correct 'application' area and at the appropriate sync point, you would code two .RESTART statements.
One would be the original .RESTART SYSTEM (A, B), and the second would be the .RESTART SYNC.
A Batch Processor (BP) script is organized into multiple 'application' areas using .SYSTEM commands.
As well, .SYNC commands must be coded at appropriate points within the 'application' areas so that work is committed, and the requisite restart records are created in the DB2 products Restart table. E.G.
... .SYSTEM AREA1 .SYNC 1050 .... various BP commands .SYSTEM AREA2 .SYNC 2050 .... various BP commands .SYSTEM AREA3 .SYNC 3050 .... various BP commands .SYSTEM AREA4 .SYNC 4050 .... various BP commands
BP JCL uses .RESTART SYSTEM(...) statement so that only certain sections of the BP script are processed.
The other sections are skipped. E.G.
Assume an error occurs in one of the referenced areas, say AREA4, and the last successful Syncpoint processed was .SYNC 4050 in AREA4.
After correcting the problem that caused the error, one would restart the job using the following control cards:
//BPIIPT DD * .CONTROL ... ... .RESTART SYSTEM (AREA2,AREA4) .RESTART SYNC
The first .RESTART card will instruct BP to only process BP cards in AREA2 and AREA4 as before.
The second .RESTART card will invoke SYNCPOINT processing, which will cause BP to skip everything up to the appropriate .SYNC 4050 card that was recorded in the DB2 products RESTART table, prior to the error.
Since the error occurred in AREA4, then this would also include skipping the BP statements in AREA 2.