IDCMAS DELETE ends with RC=08.

This Forum is for the guests or the users who are not registered on this board. This part allows guests to post in.
Previous topicNext topic

Topic Author
IDCMASDELETEQuestion

IDCMAS DELETE ends with RC=08.

Post by IDCMASDELETEQuestion » Sun Dec 06, 2015 3:21 pm

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.



User avatar

Akatsukami
Global Moderator
Global Moderator
Posts: 119
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

Re: IDCMAS DELETE ends with RC=08.

Post by Akatsukami » Sun Dec 06, 2015 7:01 pm

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.


"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli


Topic Author
IDCMASDELETEQuestion

Re: IDCMAS DELETE ends with RC=08.

Post by IDCMASDELETEQuestion » Tue Dec 08, 2015 7:21 pm

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?




nicc
Global Moderator
Global Moderator
Posts: 597
Joined: Wed Apr 23, 2014 8:45 pm

Re: IDCMAS DELETE ends with RC=08.

Post by nicc » Tue Dec 08, 2015 8:01 pm

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..


Regards
Nic

Previous topicNext topic

Return to “You are a Guest.”