How omitting the DSNAME for a temporary data set can cause a JCL error when rerunning the job using Encore

Document ID : KB000054714
Last Modified Date : 14/02/2018
Show Technical Document Details


When DSNAME is omitted in the DD statement for a temporary data set, the system assigns a new DSNAME every time the job is submitted. As a result, the JCL for the rerun of such a job is not identical to the JCL of the previous run.

For example...

//STEP10   EXEC PGM=IEFBR14                                  
//SORT1    EXEC PGM=IEFBR14                                  
//SORTOUT  DD   DISP=(NEW,PASS),                             
//          LRECL=80,RECFM=FB,                               
//          SPACE=(TRK,(1,1)),                               
//          UNIT=SYSDA                                       
//PRINT    EXEC PGM=IEFBR14                                  
//FILES    DD   DISP=SHR,DSN=CYB1.FILES  <- did not exist during initial run, so caused JCL error; created before rerun to remove this error.                      
//STEP40   EXEC PGM=IEFBR14                                  

If (1)DSNAME is omitted in the DD statement for a temporary data set which is passed to another step and (2)Encore chooses to restart the job in the other step, Encore is presently unable to detect that an earlier step needs to create the temporary data set. Encore's EXH (execution history) data for the previous run will indicate that earlier step created a data set with a system-assigned DSNAME such as SYS.TEMP1, but the system control blocks at rerun time will show that the chosen step refers to the system-assigned DSNAME=SYS1.TEMP2. If SYS1.TEMP2 does not exist and the Encore step's SYSIN data set contains PREDICT DSNOTFOUND(NO), the rerun will fail with a JCL error in the chosen step.

An online Encore restart analysis would show that Encore intends to restart the earlier step. The reason an online simulation is able to determine this, while a batch restart cannot, is that the online analysis assumes that a job's JCL is identical to the JCL of the previous run (i.e. that the temporary data set will continue to have DSNAME=SYS1.TEMP1 in a rerun.)


An obvious workaround is to manually specify the desired start step for the rerun. For future runs, it would be safer to modify the JCL to specify a DSNAME for the temporary SORTOUT data set.