One of the concurrent DMSAR tasks dynamically started by DISK in order to automatically restore archived datasets requested by batch jobs running or online ISPF users asking for them, fails with the following messages:
IEF453I DMSAR - JOB FAILED - JCL ERROR - TIME=04.30.03
MIM1038I DMSAR STCnnnnn A=008D T=9FF890 contention with DMSAR
MIM1039I DMSAR STCnnnnn A=008D T=9FF890 needs EXCL SYSDSN SYSyyddd.Thhmmss.RA000.DMSAR.A00nnn.H01
#HASP395 DMSAR ENDED
due to a contention with another DMSAR task on the temporary dataset:
SYSyyddd.Thhmmss.RA000.DMSAR.A00nnn.H01
What is wrong, and how to correct it?
Release: Disk™ Backup and Restore 12.5 and above
This error condition can randomly happen if there are many DMSAR tasks running concurrently in the same LPAR/System due to a high number of auto-restore requests for archived datasets. DMSAR TASK1 starts and executes the automatic restore of an archived dataset, allocating the temporary dsname as shown below:
‘SYSyyddd.Thhmmss.RA000.jobname.Annnnn.Hnn’.
More or less at the same time DMSAR TASK2 is dynamically started for the same reason and it tries to allocate the same new temporary dataset dsname but it fails as this dataset is already allocated to DMSAR TASK1. The result is that DMSAR TASK2 gets the contention messages and it ends in ‘JCL ERROR’, while the batch job which generated this task execution, gets the WTOR:
*83 DMS2977 DMSAR HAS NOT STARTED YET--DISCONTINUE THE WAIT FOR AUTO-RESTORE?
(Y/N)
WTOR Reply (Y or N), in any case the archived dataset is no longer restored (DMSAR TASK2 has already ended with error and another new DMSAR task cannot be automatically started by DISK) so also the batch job ends in ‘JCL ERROR’ .
A possible workaround to avoid this error situation is to modify the DMSAR procedure located in member CCUWPROC(DMSAR) in order to make the temporary dataset dsname unique to each DMSAR task started, regardless of the timeframe in which the task is executed or the number of concurrent DMSAR tasks running. It will be necessary to remove the below operand:
DSN=&&dsname from both //COMMANDS DD and //SYSIN DD ddnames of this procedure, so that the new temporary dataset dsname will be allocated using the operating system naming convention:
SYSyyddd.Thhmmss.RA000.jobname.Rggnnnnn
where gg is the SystemID and nnnnn is a unique number.