Horner Consulting

Job Stepping

This method of job design will help its recovery in the event of failure. To install these steps, you don't even need a hammer and nails. Break down your job stream into a series of sections. Eash section should begin by doing something that can make note of what section the job is in. The most common way of doing this is by building a file in the beginning of the section, and purging the file when the section is completed. Take this example under consideration.

At the beginning of the job, the system is searched for empty section files. These instructions are under the title "CHECKED FOR FAILED ATTEMPTS". The next set of instructions are 2 file equations and an execution of a program. This is STEP 1. Before the file equations, an IF statement is used to check for the existence of a file called JSTEP1. JSTEP1 is the file used as a step file. If this file exists, then it is ok to proceed with STEP 1. The last 2 instructions are the passing control between STEP 1 and STEP 2. STEP 1 ends with an ENDIF. STEP 2, like STEP 1, begins with a check for the designated step file. The instructions that make up STEP 2 are executed. Control of what step is next is passed. The step is ended, with an ENDIF. STEP 3 works much the same way as the previous steps.

Using job stepping makes recovery of a failed job easier. If a step file has been built for a particular step that is being executed when the job fails, all that needs to be done is to correct the problem and restream the job. The recovery of the job will begin in the step where the job failed.

Point and click on any of the links that make up the steps. A window will reveal what step you are in.
!JOB JOBSTEP,MANAGER.SYS;OUTCLASS=LP,1
! 
!COMMENT         ** CHECKED FOR FAILED ATTEMPTS **
!
!ERRCLEAR
!LISTF JSTEP#,6
!IF !CIERROR <> 0 THEN
!   BUILD JSTEP1
!ENDIF
!
!COMMENT         ** STEP #1 **
!
!IF FINFO("JSTEP1","EXISTS") THEN
!
!   FILE MYDB=MYDB.DATABASE
!   FILE TRANFILE=TRANFILE
!   RUN UPDB.PUB
!   PURGE JSTEP1
!   BUILD JSTEP2
!
!ENDIF
!
!COMMENT         ** STEP #2 **
!
!IF FINFO("JSTEP2","EXISTS") THEN
!
!   FILE REPTDB=MYDB.DATABASE
!   FILE RPT1;DEV=LP,8;CCTL
!   RUN REPT1.PUB
!   PURGE JSTEP2
!   BUILD JSTEP3
!
!ENDIF
!
!COMMENT         ** STEP #3 **
!
!IF FINFO("JSTEP3","EXISTS") THEN
!
!   FILE REPTDB1=MYDB.DATABASE
!   FILE REPTDB2=MASTDB.DATABASE
!   FILE RPT2;DEV=LP,8;CCTL
!   RUN REPT2.PUB
!   PURGE JSTEP3
!
!ENDIF
!
!EOJ