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

IDCMAS DELETE ends with RC=08.

Post 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.
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: IDCMAS DELETE ends with RC=08.

Post 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.
"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
IDCMASDELETEQuestion

Re: IDCMAS DELETE ends with RC=08.

Post 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?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: IDCMAS DELETE ends with RC=08.

Post 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..
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “You are a Guest.”