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

JCL to Uncatlog & Delete a dataset


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

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Thu May 18, 2006 10:55 am
Reply with quote

Hi:
I want to uncatalog and delete a tape dataset.
Please give a JCL code that does it.

Thanks in Advance
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Thu May 18, 2006 6:52 pm
Reply with quote

You can use the IDCAMS command,
Delete 'DS.TAPE',PURGE

Typically in a Shop if you delete a Tape, what you are doing is just Uncataloging it, and not deleting the data present in the Tape itself. Every day a Job (I am not able to remember what the Job actually does) would be run to reclaim the Uncatalogued Tape to be availabe for future uses. That means you can retrieve the data from the tape before the Job is run, even though you have 'deleted' it.
Back to top
View user's profile Send private message
Jag

New User


Joined: 07 Dec 2005
Posts: 30
Location: India

PostPosted: Thu May 18, 2006 9:10 pm
Reply with quote

//Job statement.......
//STep01 exec pgm=IEFBR14
//dd1 dd dsn=YOUR DDNAME,disp=(old,UNCATLG)
//

Upon the succesfull execution of the job..The dataset will be uncataloged..


Please let me know if i am wrong..

Cheers,
Jag
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Thu May 18, 2006 9:39 pm
Reply with quote

Your Job will uncatalogue a Dataset, but I am not sure if this Uncatalogued Tape will be reclaimed for future uses, your Tape support Guys may know better. But if you use the below IDCAMS step, the tape will be reclaimed for future uses automatically.
Code:
//LISTCAT EXEC PGM=IDCAMS   
//SYSPRINT DD SYSOUT=*       
//SYSIN    DD *
  Delete 'DS.TAPE' PURGE     
/*       
Back to top
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Fri May 19, 2006 4:39 pm
Reply with quote

Hi die7nadal:
I have coded 2 steps using IEFBR14 like below to uncatlog and delete the Tape datasets.


//D256193D JOB 'DPINC117','ASWINI',CLASS=X,
// MSGLEVEL=(1,1),NOTIFY=&SYSUID,MSGCLASS=X
//UNCDEL EXEC PGM=IEFBR14
//SYSUT1 DD DSN=OFFSITE.DIS001D.G0002V00,
// DISP=(MOD,UNCATLG,UNCATLG)
//SYSUT2 DD DSN=OFFSITE.DIS001D.G0002V00,
// DISP=(MOD,DELETE,DELETE)
//SYSIN DD *

Please correct me if I m wrong.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Fri May 19, 2006 6:40 pm
Reply with quote

You cannot use this method to delete Tapes, you have to use IDCAMS.
Back to top
View user's profile Send private message
sundaresanjs

New User


Joined: 29 May 2006
Posts: 18
Location: USA

PostPosted: Mon May 29, 2006 5:54 pm
Reply with quote

hai monasu1998,

you can use the utility IEHPROGM which do the following things

1. Scratches datasets or member of a PDS on a DASD vol
2. Renames the datasets or members
3. Catalogs or Uncatalogs the datasets
4. Builds or deletes a catlog index
5. builds or deletes a GDG

example for delete

//JOBID JOB SUNDAR,'CHENNAI'
//STEP1 EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD UNIT=TAPE,VOL=SER=SMS009 (SERIAL NUMBER)
//SYSIN DD *
DELETE DSNAME=DATA1.SSS,VOL=SER=SMS009 -
PURGE
/*
//


note me if there is any mistake

regards

Sundaresan J
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top