Page 1 of 1

How to avoid contention with delete idcams

PostPosted: Fri Oct 25, 2013 1:46 pm
by samb01
Heelo,

i have contention between two jobs on one file :

Job01 is trying to dump it by adrdssu with the option :

DUMP OUTDDNAME(OUTDD1)                    -                   
     DATASET(INCL(                        -                   
                  AAA.*.**)               -                   
             EXCL(                        -                   
                  AAA.BBB.**, -
                  AAA.V*.*.A*.BBB       -                   
                                      )) -                   
CANCELERROR TOL(ENQF) OPTIMIZE(4) FORCECP(0) WAIT(1,2) SHARE 
IF MAXCC =4 THEN SET MAXCC=0;                                 




Job02 is trying to delete it by idcams

//DELETE EXEC PGM=IDCAMS                   
//SYSPRINT DD SYSOUT=*                     
//SYSIN  DD *                             
DELETE AAA.YYY.ZZZ   



And the Job02 is abended with RC=08.

I would like to know if ist's possible to prevent the abned of the job02 (avoid the RC=08...). The message is

   DELETE AAA.YYY.ZZZ                                07050
0IKJ56225I DATA SET AAA.YYY.ZZZ ALREADY IN USE, TRY       
 IKJ56225I LATER                                                             
 IKJ56225I DATA SET IS ALLOCATED TO ANOTHER JOB OR USER                       
 IDC0551I ** ENTRY AAA.YYY.ZZZ NOT DELETED               
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8                   
0                                                                             



Thank's for your help.

Re: How to avoid contention with delete idcams

PostPosted: Fri Oct 25, 2013 3:07 pm
by Robert Sample
//DELETE EXEC PGM=IDCAMS                   
//DD01     DD DISP=OLD,DSN=AAA.YYY.ZZZ
//SYSPRINT DD SYSOUT=*                     
//SYSIN  DD *                             
DELETE AAA.YYY.ZZZ   
will not allow this job to run until the data set is available.

Re: How to avoid contention with delete idcams

PostPosted: Fri Oct 25, 2013 3:10 pm
by Stefan
If you really want the second job to continue although the dataset cannot be deleted than improve the IDCAMS step by overwriting the "bad" return code like this:

//DELETE EXEC PGM=IDCAMS                   
//SYSPRINT DD SYSOUT=*                     
//SYSIN  DD *                             
DELETE AAA.YYY.ZZZ
IF MAXCC EQ 8 THEN SET MAXCC = 0
/*

Re: How to avoid contention with delete idcams

PostPosted: Fri Oct 25, 2013 4:54 pm
by samb01
Yes but the file will not be deleted...

Re: How to avoid contention with delete idcams

PostPosted: Fri Oct 25, 2013 5:45 pm
by BillyBoyo
If you are doing a BACKUP at some point and a DELETE at some point, then there is a logical order to things.

For this type of logical ordering, you use your Scheduler package.

If you have a timing problem, in that you can't wait to have the entire backup complete before your delete runs, then split the backup.

The short answer is, make the DELETE job dependent on the BACKUP job. With whatever arrangements you need to have that meet your timing requirements.