IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Error while deleting a DATASET using IDCAMS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Sun Mar 24, 2013 1:31 pm
Reply with quote

Hi all..
I am trying to delete a dataset using IDCAMS.
The dataset already exists.
But the JCL ends with RC 8.
Anyone has an idea on how to fix it ?

I am pasting the JCL here :

//R04290V JOB (VV,BOBBY),'SIDDU',NOTIFY=&SYSUID
//*
//*********************************************************
//*
//* STEP TO DELETE THE DELE THE DATASET LAL.RES.FLALF037
//*
//*********************************************************
//*
//STP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//FILE DD DSN=R04290.DELETE.DATASET,DISP=(MOD,DELETE)
//SYSIN DD *
DELETE FILE
/*

N: The data set is deleting if the DISP=(MOD,DELETE)
The data set is not deleting if the DISP=OLD

But the return code for both of them is 8.


Any help would be appreciated.
Thank you.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 24, 2013 1:54 pm
Reply with quote

the error is due to the fact that You did not care to read the manuals
about the SYNTAX/FORMAT of the DELETE statement

start from
www-03.ibm.com/systems/z/os/zos/bkserv/index.html

and navigate to the bookshelf for the version/level of Your zOS
to arrive at something like
publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.idai200/da6i2172.htm

and also do not forget to read and meditate on the
JCL guide
JCL reference
Back to top
View user's profile Send private message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Sun Mar 24, 2013 2:43 pm
Reply with quote

@Enrico,

Hi enrico.
If the disp=(MOD,DELETE) the dataset is deleting.
But the RC is 8.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 24, 2013 2:48 pm
Reply with quote

what is that You did not understand when I told ...

Quote:
the error is due to the fact that You did not care to read the manuals
about the SYNTAX/FORMAT of the DELETE statement


RTFM

anyway You are mixing up things ...

You must take a decision if You want
JCL to delete the dataset DISP=(<whatever>,DELETE)
or You want to do it using idcams
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Mar 24, 2013 2:59 pm
Reply with quote

enrico-sorichetti wrote:
You must take a decision if You want
JCL to delete the dataset DISP=(<whatever>,DELETE)
or You want to do it using idcams
On a lighter note - If that understanding had been in place, question had not been asked at first place, IMHO! icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 24, 2013 3:05 pm
Reply with quote

but still the TS could have looked at the manuals to search for the message he received by IDCAMS

Code:
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,
 000002 //             REGION=0M,
 000003 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
 000004 //*
 000005 //IDC     EXEC PGM=IDCAMS
 000006 //FILE      DD DISP=OLD,DSN=ENRICO.TEST.SOMEFILE
 000007 //SYSPRINT  DD SYSOUT=*
 000008 //SYSIN     DD *
 000009   DELETE FILE
 ****** **************************** Bottom of Data ****************************


to get
Code:
********************************* TOP OF DATA **********************************
IDCAMS  SYSTEM SERVICES                                           TIME: 10:18:51

  DELETE FILE
IDC3012I ENTRY FILE NOT FOUND
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEG-42
IDC0551I ** ENTRY FILE NOT DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8

IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 8
******************************** BOTTOM OF DATA ********************************


that' s what the TS should have had the decency to post
but the TS did not care.

the TS qualifies as STUDENT, but he has a pretty shitty attitude for a student aiming to learn something
( whatever the field )

where is the intellectual need for research ... most probably down the toilet icon_wink.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 24, 2013 3:18 pm
Reply with quote

advice to the TS
to make the most out of the questions You ask,
You should read and meditate on
How To Ask Questions The Smart Way
here
catb.org/~esr/faqs/smart-questions.html
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sun Mar 24, 2013 6:44 pm
Reply with quote

tamminenisidhartha, I strongly recommend you stop posting on this forum and switch to Beginners and Students Forum as the expertise and attitude you expressed in your posts in this thread indicate that you are not a professional but a beginner (no matter how many years of "experience" you claim to have).

Quote:
If the disp=(MOD,DELETE) the dataset is deleting.
But the RC is 8.
Your results are EXACTLY what you should get -- the system is working precisely as designed, even to the RC 8.
Back to top
View user's profile Send private message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Tue Apr 02, 2013 7:46 pm
Reply with quote

I have done it successfully.

Thank you for all the valuable suggestions.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Wed Apr 03, 2013 12:07 am
Reply with quote

I usually do something like...
Code:
//STEP010  EXEC PGM=IDCAMS           
//SYSPRINT DD SYSOUT=*               
//SYSOUD   DD SYSOUT=*               
//SYSOUT   DD SYSOUT=*               
//SYSIN    DD *                       
   DELETE FILE.NAME.HERE        PURGE
     IF MAXCC < 12 THEN SET MAXCC = 0
/*                                   
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 03, 2013 1:13 pm
Reply with quote

Gary McDowell wrote:
I usually do something like...
Code:
//STEP010  EXEC PGM=IDCAMS           
//SYSPRINT DD SYSOUT=*               
//SYSOUD   DD SYSOUT=*               
//SYSOUT   DD SYSOUT=*               
//SYSIN    DD *                       
   DELETE FILE.NAME.HERE        PURGE
     IF MAXCC < 12 THEN SET MAXCC = 0
/*                                   


...and, if the TS had coded this, the issue would have been masked by resetting the CC=8. Not really ideal, IMHO.

Garry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top