Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL to Uncatlog & Delete a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL to Uncatlog & Delete a dataset
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us