Page 1 of 1

IDCMAS DELETE ends with RC=08.

Posted: Sun Dec 06, 2015 3:21 pm
by IDCMASDELETEQuestion
Hi,

I try to delete a dataset, which exists, using IDCAMS. The JCL ends with RC 8.

Code: Select all

//* 
//* STEP TO DELETE THE DATASET
//* 
//STP01 EXEC PGM=IDCAMS 
//SYSPRINT DD SYSOUT=* 
//FILE DD DSN=DELETE.THIS.DATASET,DISP=(MOD,DELETE) 
//SYSIN DD * 
DELETE FILE 
/* 
Strangely the data set is deleting if the DISP=(MOD,DELETE) but the data set does not delete if the DISP=OLD. :sorry: But the return code for both of them is 8.

Re: IDCMAS DELETE ends with RC=08.

Posted: Sun Dec 06, 2015 7:01 pm
by Akatsukami
The IDCAMS command is wrong; it should be DELETE FILE(ddname), hence the RC=8. If the disposition is (MOD,DELETE), the data set is deleted by the OS, not IDCAMS; if the disposition is OLD (which implies KEEP, KEEP), it is not deleted.

Re: IDCMAS DELETE ends with RC=08.

Posted: Tue Dec 08, 2015 7:21 pm
by IDCMASDELETEQuestion
Akatsukami wrote:The IDCAMS command is wrong; it should be DELETE FILE(ddname), hence the RC=8. If the disposition is (MOD,DELETE), the data set is deleted by the OS, not IDCAMS; if the disposition is OLD (which implies KEEP, KEEP), it is not deleted.
Hmm .. now understood. Will DISP work like this for any program?

Re: IDCMAS DELETE ends with RC=08.

Posted: Tue Dec 08, 2015 8:01 pm
by nicc
If you do not understand and you use JCL then I suggest, strongly, that you read the JCL Reference manual as DISP has nothing to do with the program being executed..