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
 

 

IEFBR14 to delete tape without tape mount

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Lynne Schuler

New User


Joined: 15 Jan 2015
Posts: 22
Location: USA

PostPosted: Thu Jan 29, 2015 8:51 am    Post subject: IEFBR14 to delete tape without tape mount
Reply with quote

I usually use IDCAMS to delete a tape, but in this JCL, I wish to use the SET to set up a variable for the tape dataset name. I am using that name in several job steps, so it makes it easier, plus I might change the name - and it minimizes what I need to change.

But I can't use a set variable in IDCAMS (for sysin)

So, I thought I would use IEFBR14 which works, unless the file is a tape. Is there any way to avoid the tape mount when I use IEFBR14?

Or maybe another quick way to delete a tape file where I could use a set variable?
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Thu Jan 29, 2015 9:46 am    Post subject:
Reply with quote

Option 1 -
Code:
// SET NAME='?'
//DELETE  EXEC PGM=IEFBR14
//KILLDS   DD  DISP=(OLD,DELETE),UNIT=(,DEFER),
//             DSN=&NAME

Option 2 -
Code:
// SET NAME='?'
//DELETE  EXEC PGM=IKJEFT01,PARM='DELETE ''&NAME'' NOSCRATCH'
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
The UNIT=(,DEFER) in option 1 will prevent the mount, though a tape drive will be allocated for a few seconds.

In option 2, it is not widely appreciated that the TSO DELETE command is really just a front end for the IDCAMS DELETE command
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 29, 2015 6:51 pm    Post subject: Re: IEFBR14 to delete tape without tape mount
Reply with quote

Lynne Schuler wrote:

But I can't use a set variable in IDCAMS (for sysin)


Why not?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Jan 29, 2015 7:54 pm    Post subject: Reply to: IEFBR14 to delete tape without tape mount
Reply with quote

Not up-to-date with release of z/OS?
Back to top
View user's profile Send private message
Lynne Schuler

New User


Joined: 15 Jan 2015
Posts: 22
Location: USA

PostPosted: Sat Jan 31, 2015 6:06 am    Post subject:
Reply with quote

Thank you, Steve Meyers for your post.

However, I did do some more research after posting this question, and I found out z/OS v2r1 has added the JCL EXPORT statement which allows JCL and system variables to be included/interpreted in SYSIN data. So, that is what I did, and it works great.

For anyone else with this question, here is a link to the article that I found on this:
article

and a link to the documentation
documentation
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 JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts stacking files on a tape Pedro JCL & VSAM 7 Wed Aug 17, 2016 11:11 pm
No new posts Delete record or Reset RC code using ... mpawan Compuware & Other Tools 4 Tue Jul 26, 2016 3:52 pm
No new posts Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm


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